systemd verifiy if sshd services is active/inactive code example
Example: systemd verifiy if sshd services is active/inactive
$ systemctl is-active sshd
active
$ systemctl is-active foo
inactive
$ systemctl is-active sshd
active
$ systemctl is-active foo
inactive