Check SMART status on MacOS and pop up alert
Some suggestions:


A direct string comparison test may be flaky especially if the string contains multiple space characters. I can think of three alternatives:


Use regex matching: this can be achieved by the =~ operator inside [[ ]]: if [[ ! "$A" =~ Verified ]].
Use awk:

A=$(diskutil info disk0 | awk '/SMART Status:/{print $NF}')
if [ "$A" != 'Verified' ]
# ...

Check exit status instead of output:

if sudo smartctl -H -q silent /dev/disk0
# ...


Use more descriptive names: smart_status_text is more self-evident than A.
Properly format your code: indent the commands inside the if block and don't leave a blank line after then.