From 155a24fe8f9b93660700519533ba84479477db0c Mon Sep 17 00:00:00 2001 From: "cnb.dg2025-08" Date: Sun, 14 Sep 2025 19:28:58 +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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cns/cns.sh b/cns/cns.sh index adfa0ac..b28f538 100644 --- a/cns/cns.sh +++ b/cns/cns.sh @@ -101,7 +101,7 @@ InstallFiles() { } EOF chmod -R +rwx "$cns_install_dir" /etc/init.d/Acns - if type systemctl && [ -z "$(systemctl --failed|grep -q 'Host is down')" ]; then + if type systemctl >/dev/null 2>&1 && [ -z "$(systemctl --failed|grep -q 'Host is down')" ]; then $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 @@ -166,7 +166,7 @@ Install() { InstallInit InstallFiles "${cns_install_dir}/cns.init" start|grep -q FAILED && Error "cns install failed." - type systemctl && [ -z "$(systemctl --failed|grep -q 'Host is down')" ] && systemctl restart cns + type systemctl >/dev/null 2>&1 && [ -z "$(systemctl --failed|grep -q 'Host is down')" ] && systemctl restart cns echo $echo_e_arg \ "\033[44;37mcns install success.\033[0;34m \r cns server port:\033[35G${cns_port}