From a4f90c06388816d68f96be155565bd377d935d99 Mon Sep 17 00:00:00 2001 From: "cnb.dg2025-08" Date: Sun, 14 Sep 2025 09:39:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=96=87=E4=BB=B6=20cns.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cns/cns.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/cns/cns.sh b/cns/cns.sh index 512ecf6..b77efc2 100644 --- a/cns/cns.sh +++ b/cns/cns.sh @@ -5,7 +5,7 @@ #Stop cns & delete cns files. Delete() { - systemctl disable cns.service + systemctl disable Acns.service chkconfig --del cns /etc/init.d/Acns disable @@ -13,7 +13,7 @@ Delete() { "$cns_install_dir"/cns.init stop rm -rf "$cns_install_dir" fi - rm -f /etc/init.d/Acns /lib/systemd/system/cns.service /etc/rc.d/rc5.d/S99cns /etc/rc.d/S99cns /etc/rc5.d/S99cns + rm -f /etc/init.d/Acns /lib/systemd/system/Acns.service /etc/rc.d/rc5.d/S99cns /etc/rc.d/S99cns /etc/rc5.d/S99cns } #Print error message and exit. @@ -102,9 +102,9 @@ InstallFiles() { EOF chmod -R +rwx "$cns_install_dir" /etc/init.d/Acns if type systemctl && [ -z "$(systemctl --failed|grep -q 'Host is down')" ]; then - $download_tool_cmd /lib/systemd/system/cns.service https://cnb.cool/dg2025-08/Cax/-/git/raw/main/cns/cns.service || Error "cns.service download failed." - chmod +rwx /lib/systemd/system/cns.service - sed -i "s~\[cns_install_dir\]~$cns_install_dir~g" /lib/systemd/system/cns.service + $download_tool_cmd /lib/systemd/system/Acns.service https://cnb.cool/dg2025-08/Cax/-/git/raw/main/cns/cns.service || Error "Acns.service download failed." + chmod +rwx /lib/systemd/system/Acns.service + sed -i "s~\[cns_install_dir\]~$cns_install_dir~g" /lib/systemd/system/Acns.service systemctl daemon-reload fi } @@ -134,26 +134,26 @@ AddAutoStart() { fi fi if type chkconfig &>/dev/null; then - if chkconfig --add cns &>/dev/null && chkconfig cns on &>/dev/null; then - echo '已添加开机自启, 如需关闭请执行: chkconfig cns off' + if chkconfig --add Acns &>/dev/null && chkconfig cns on &>/dev/null; then + echo '已添加开机自启, 如需关闭请执行: chkconfig Acns off' return fi fi if [ -d '/etc/rc.d/rc5.d' -a -f '/etc/init.d/Acns' ]; then - if ln -s '/etc/init.d/Acns' '/etc/rc.d/rc5.d/S99cns'; then - echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc.d/rc5.d/S99cns' + if ln -s '/etc/init.d/Acns' '/etc/rc.d/rc5.d/S99Acns'; then + echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc.d/rc5.d/S99Acns' return fi fi if [ -d '/etc/rc5.d' -a -f '/etc/init.d/Acns' ]; then - if ln -s '/etc/init.d/Acns' '/etc/rc5.d/S99cns'; then - echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc5.d/S99cns' + if ln -s '/etc/init.d/Acns' '/etc/rc5.d/S99Acns'; then + echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc5.d/S99Acns' return fi fi if [ -d '/etc/rc.d' -a -f '/etc/init.d/Acns' ]; then - if ln -s '/etc/init.d/Acns' '/etc/rc.d/S99cns'; then - echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc.d/S99cns' + if ln -s '/etc/init.d/Acns' '/etc/rc.d/S99Acns'; then + echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc.d/S99Acns' return fi fi