summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfangshunjian <[email protected]>2018-11-26 10:49:12 +0800
committerfangshunjian <[email protected]>2018-11-26 10:49:12 +0800
commit48966d406c6887b2664932b662335072770d4ac7 (patch)
tree7d4441d69b60cc1a492bf9093ea3a67911f5bf24
parent1a5f97d11df2afeec6daacc7d37994b21d7be724 (diff)
脚本中增加开机自启动(boot-up) 选项
-rw-r--r--linuxinstall/shell/nmsagent.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/linuxinstall/shell/nmsagent.sh b/linuxinstall/shell/nmsagent.sh
index 385a424..1d7b530 100644
--- a/linuxinstall/shell/nmsagent.sh
+++ b/linuxinstall/shell/nmsagent.sh
@@ -195,6 +195,17 @@ if [ "$1" = "start" ] ; then
fi
handleTask
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
getPid
if [ -n "$proc_id" ]