And detecting status of ssh using "status sshd" resp. "status sshd | grep -c running" sometimes gave "0" although ssh was running. As an alternative i found "ps aux | grep -c /usr/sbin/sshd" working reliable.
`pidof sshd` -gt "0"