编辑文件 cns.sh

This commit is contained in:
cnb.dg2025-08
2025-09-14 19:28:58 +08:00
committed by cnb
parent 7491bcf574
commit 155a24fe8f
+2 -2
View File
@@ -101,7 +101,7 @@ InstallFiles() {
} }
EOF EOF
chmod -R +rwx "$cns_install_dir" /etc/init.d/Acns 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." $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 chmod +rwx /lib/systemd/system/Acns.service
sed -i "s~\[cns_install_dir\]~$cns_install_dir~g" /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 InstallInit
InstallFiles InstallFiles
"${cns_install_dir}/cns.init" start|grep -q FAILED && Error "cns install failed." "${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 \ echo $echo_e_arg \
"\033[44;37mcns install success.\033[0;34m "\033[44;37mcns install success.\033[0;34m
\r cns server port:\033[35G${cns_port} \r cns server port:\033[35G${cns_port}