Update cns.sh
This commit is contained in:
parent
88d935ccec
commit
7373779e42
@ -71,8 +71,8 @@ InstallFiles() {
|
||||
fi
|
||||
mkdir -p "$cns_install_dir" || Error "Create cns install directory failed."
|
||||
cd "$cns_install_dir" || exit 1
|
||||
$download_tool_cmd cns http://xray.540186.xyz/dxy/cns/linux_${machine} || Error "cns download failed."
|
||||
$download_tool_cmd cns.init http://xray.540186.xyz/dxy/cns/cns.init || Error "cns.init download failed."
|
||||
$download_tool_cmd cns https://github.com/a131878/cns/blob/main/cns/linux_${machine} || Error "cns download failed."
|
||||
$download_tool_cmd cns.init https://github.com/a131878/cns/edit/main/cns/cns.init || Error "cns.init download failed."
|
||||
[ -f '/etc/rc.common' ] && rcCommon='/etc/rc.common'
|
||||
sed -i "s~#!/bin/sh~#!$SHELL $rcCommon~" cns.init
|
||||
sed -i "s~\[cns_start_cmd\]~$cns_start_cmd~g" cns.init
|
||||
@ -99,7 +99,7 @@ InstallFiles() {
|
||||
EOF
|
||||
chmod -R +rwx "$cns_install_dir" /etc/init.d/cns
|
||||
if type systemctl && [ -z "$(systemctl --failed|grep -q 'Host is down')" ]; then
|
||||
$download_tool_cmd /lib/systemd/system/cns.service http://xray.540186.xyz/dxy/cns/cns.service || Error "cns.service download failed."
|
||||
$download_tool_cmd /lib/systemd/system/cns.service https://github.com/a131878/cns/edit/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
|
||||
systemctl daemon-reload
|
||||
|
Loading…
x
Reference in New Issue
Block a user