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}