mdiag has bash-specific syntax, so use #!/bin/bash

See full rationale in the first commit.