脚本中增加开机自启动(boot-up) 选项

This commit is contained in:
fangshunjian
2018-11-26 10:49:12 +08:00
parent 1a5f97d11d
commit 48966d406c

View File

@@ -195,6 +195,17 @@ if [ "$1" = "start" ] ; then
fi fi
handleTask handleTask
fi fi
elif [ "$1" = "boot-up" ]; then
#设置开机自启动
if [ -z "$(cat /etc/rc.local|grep -E "^\s*$NMSCLEINT_HOME/shell/startup.sh")" ]
then
echo "">> /etc/rc.local
echo "########## nmsclient开机启动 ###########" >> /etc/rc.local
echo $NMSCLEINT_HOME"/shell/startup.sh" >> /etc/rc.local
echo "Boot-up settings complete!"
else
echo "Boot-up has been set up without modification."
fi
elif [ "$1" = "stop" ]; then elif [ "$1" = "stop" ]; then
getPid getPid
if [ -n "$proc_id" ] if [ -n "$proc_id" ]