判断ssh是否运行


1
2
3
4
5
6
7
8
#!/bin/bash
service=$( systemctl is-active sshd )
if [ "$service" == active ];then
echo "$service is running"
else
systemctl restart sshd
echo "sshd is started"
if
阅读剩余
THE END