I've faced a few Shazams here and there and I feel DS can take the match pretty handily.
Atlas Torpedo should almost always be punishable by Sword Flip, so if they are just spamming it I would check with that after.
Anti-airing is as easy as D2 or Sword Flip, whichever you prefer.
Teleport is annoying but if they start doing a rote pattern doing a machine gun can actually knock him for a few percent as he comes out. I would try it. On wakeup it's a different beast, and oki is pretty different on Shazam since he can get out of most of it pretty free.
22 xx grabs are backdashable, and 22 xx torpedo will beat that. Typically I go for a crouch, and see if I can react to the torpedo coming out. You may also be able to reversal after 22 before anything hits, although I'm not 100% on that. If I get hit by the low grab I will just deal with it usually, it's not huge damage.
One thing that really helps here is knowing that Shazam going into command grab after b2 is a bill as it will not connect on block. The problem is how fast it will recover, but I'm sure DS can get a b1 punish on that attempt.
Another thing is that since Shazam's approach is pretty limited, down 2 is really a big block on his offense. The lingering nature of its active frames will really go to town on back 2, and his dashes are long ranged but will be slow on the recovery, easy to smack. It recovers so fast that him whiff punishing the d2 can be difficult, and sweep is really his only option, provided he's in range.
To me what hurts Shazam is that he has a hard time getting in as all his avenues are either punishable (Torpedo, b23) or moves that are sort of smoke and mirrors and have answers if one is knowledgeable (Teleport in, b2 xx command grab). He could also jump, but this is nigh impossible against DS.
Shazam does have a few things going for him, like his backdash being so good and his mixups are pretty good, but he's doing most of the guessing, and that sucks for him. As @
Heroic_Legacy once said, the idea with Shazam is to focus on the knockdown and not really concern with how bad the matchup is, and that's all Shazam can really do is run in and hope that none of his options are caught.