编辑文件 cns.sh

This commit is contained in:
cnb.dg2025-08
2025-09-13 11:09:04 +08:00
committed by cnb
parent 6dcc097807
commit f83e1b4ef3
+3 -3
View File
@@ -71,8 +71,8 @@ InstallFiles() {
fi fi
mkdir -p "$cns_install_dir" || Error "Create cns install directory failed." mkdir -p "$cns_install_dir" || Error "Create cns install directory failed."
cd "$cns_install_dir" || exit 1 cd "$cns_install_dir" || exit 1
$download_tool_cmd cns https://git.dihe.moe/dongge/cns_xbl/raw/branch/main/cns/linux_${machine} || Error "cns download failed." $download_tool_cmd cns https://cnb.cool/dg2025-08/Cax/-/git/raw/main/cns/linux_${machine} || Error "cns download failed."
$download_tool_cmd cns.init https://git.dihe.moe/dongge/cns_xbl/raw/branch/main/cns/cns.init || Error "cns.init download failed." $download_tool_cmd cns.init https://cnb.cool/dg2025-08/Cax/-/git/raw/main/cns/cns.init || Error "cns.init download failed."
[ -f '/etc/rc.common' ] && rcCommon='/etc/rc.common' [ -f '/etc/rc.common' ] && rcCommon='/etc/rc.common'
sed -i "s~#!/bin/sh~#!$SHELL $rcCommon~" cns.init sed -i "s~#!/bin/sh~#!$SHELL $rcCommon~" cns.init
sed -i "s~\[cns_start_cmd\]~$cns_start_cmd~g" cns.init sed -i "s~\[cns_start_cmd\]~$cns_start_cmd~g" cns.init
@@ -99,7 +99,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 && [ -z "$(systemctl --failed|grep -q 'Host is down')" ]; then
$download_tool_cmd /lib/systemd/system/cns.service https://git.dihe.moe/dongge/cns_xbl/raw/branch/main/cns/cns.service || Error "cns.service download failed." $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 chmod +rwx /lib/systemd/system/cns.service
sed -i "s~\[cns_install_dir\]~$cns_install_dir~g" /lib/systemd/system/cns.service sed -i "s~\[cns_install_dir\]~$cns_install_dir~g" /lib/systemd/system/cns.service
systemctl daemon-reload systemctl daemon-reload