编辑文件 cns.sh

This commit is contained in:
cnb.dg2025-08
2025-09-14 08:26:27 +08:00
committed by cnb
parent 6a4d5c9536
commit 2c324c1329
+7 -7
View File
@@ -119,8 +119,8 @@ InstallInit() {
AddAutoStart() { AddAutoStart() {
if [ -n "$rcCommon" ]; then if [ -n "$rcCommon" ]; then
if /etc/init.d/cns enable; then if /etc/init.d/Acns enable; then
echo '已添加开机自启, 如需关闭请执行: /etc/init.d/cns disable' echo '已添加开机自启, 如需关闭请执行: /etc/init.d/Acns disable'
return return
fi fi
fi fi
@@ -136,19 +136,19 @@ AddAutoStart() {
return return
fi fi
fi fi
if [ -d '/etc/rc.d/rc5.d' -a -f '/etc/init.d/cns' ]; then if [ -d '/etc/rc.d/rc5.d' -a -f '/etc/init.d/Acns' ]; then
if ln -s '/etc/init.d/cns' '/etc/rc.d/rc5.d/S99cns'; then if ln -s '/etc/init.d/Acns' '/etc/rc.d/rc5.d/S99cns'; then
echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc.d/rc5.d/S99cns' echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc.d/rc5.d/S99cns'
return return
fi fi
fi fi
if [ -d '/etc/rc5.d' -a -f '/etc/init.d/cns' ]; then if [ -d '/etc/rc5.d' -a -f '/etc/init.d/Acns' ]; then
if ln -s '/etc/init.d/cns' '/etc/rc5.d/S99cns'; then if ln -s '/etc/init.d/Acns' '/etc/rc5.d/S99cns'; then
echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc5.d/S99cns' echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc5.d/S99cns'
return return
fi fi
fi fi
if [ -d '/etc/rc.d' -a -f '/etc/init.d/cns' ]; then if [ -d '/etc/rc.d' -a -f '/etc/init.d/Acns' ]; then
if ln -s '/etc/init.d/Acns' '/etc/rc.d/S99cns'; then if ln -s '/etc/init.d/Acns' '/etc/rc.d/S99cns'; then
echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc.d/S99cns' echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc.d/S99cns'
return return