#!/bin/bash
S=$(/usr/bin/svcs -H -o STATE sasm)
if [[ "$S" == "maintenance" ]]
then
echo "SASM is in maintenance state"
else
echo "SASM is running fine"
fi
Also adding quotes surrounding $S, if $S is empty it will be an error otherwise.
If you use [[ ... ]] like @panu suggested you don't need surrounding quotes.