上传文件至 /

This commit is contained in:
xiaoshun 2024-05-30 20:47:26 +08:00
parent b8d802f54d
commit 592065da22
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
#!/usr/bin/bash
#检查服务是否关闭
#by fuxiaoshun 3/29
read -p "请输入服务名:" name
ss -tnlp | grep $name &>/dev/null
if [ $? -eq 0 ];then
echo "服务已经启动"
else
yum -y install $name &>/dev/null
systemctl restart $name
echo "$name 重新启动成功"
fi