3 个回答

if 判断就不对,少了then和空格,还有函数名不要使用和命令一样

if [ command ];then
    为真时执行的语句
else
    不为真时执行
fi

错误不告诉你了,if 结构语法不正确,少分号。

这种启动服务的脚本应该用systemctl来处理,你会发现真香。

推荐问题