Compare commits
56 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2c648e5d5a | |||
| 155a24fe8f | |||
| 7491bcf574 | |||
| 5c681eeca5 | |||
| 02f17f8e8f | |||
| 2e41f95ee9 | |||
| 04284716ea | |||
| 8026ce7854 | |||
| 947f9646ee | |||
| a4f90c0638 | |||
| e80218aeb5 | |||
| 2c324c1329 | |||
| 6a4d5c9536 | |||
| 980316897c | |||
| 30beadbb48 | |||
| f83e1b4ef3 | |||
| 6dcc097807 | |||
| 34405cee37 | |||
| 2d91d4243a | |||
| 63dea3bee1 | |||
| 61b9d7201f | |||
| c20689f43c | |||
| d30b738a85 | |||
| 363cebee4e | |||
| 2ddb31eb07 | |||
| eda7d09684 | |||
| 466b6bdb70 | |||
| 71c586828d | |||
| 1cbfa81bb4 | |||
| 26f5d54bc1 | |||
| 5832ea2860 | |||
| 9834b411a8 | |||
| 93d390c8dc | |||
| c392e4700a | |||
| e1acd12a98 | |||
| e9fca06f18 | |||
| b311535047 | |||
| 7b6a699ec2 | |||
| 9e5b939fa2 | |||
| c336c87f10 | |||
| 4efacdba86 | |||
| 6e3f88bcaa | |||
| e11f89d4ea | |||
| 22f3074b41 | |||
| 9dccd4de5e | |||
| 025d4f89a1 | |||
| 0bcb68360c | |||
| 1d9980d90b | |||
| d5f54dd6eb | |||
| 5b45099794 | |||
| 8826783f87 | |||
| ac72f21f83 | |||
| 4776de81b6 | |||
| b8cbeceacf | |||
| 989324255c | |||
| 5862db39c2 |
@@ -1,4 +1,22 @@
|
||||
## cns,amy,xray免流修改版20250913
|
||||
```
|
||||
wget -O builds.sh https://gh.0507.dpdns.org/https://github.com/a131878/cns/blob/main/builds.sh && sh builds.sh
|
||||
wget -O builds.sh https://cnb.cool/dg2025-08/Cax/-/git/raw/main/builds.sh && sh builds.sh
|
||||
|
||||
```
|
||||
|
||||
## 杀死全部进程命令
|
||||
|
||||
·············································
|
||||
|
||||
/etc/init.d/cns restart#下面命令添加进原脚本 会杀死cns自己,所以下面命令单独使用
|
||||
|
||||
kill -s 15 $(pidof cns) >/dev/null 2>&1
|
||||
|
||||
kill -9 $(pgrep cns) >/dev/null 2>&1
|
||||
|
||||
kill -s 15 $(ps -ef|grep cns | grep -v grep)
|
||||
|
||||
killall cns > /dev/null 2> 1
|
||||
|
||||
··············································
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ stop()
|
||||
status | grep stopped && return 0
|
||||
echo -n "Stopping amy4Server:"
|
||||
kill `cat [amy4Server_install_dir]/drun.pid` `cat [amy4Server_install_dir]/run.pid`
|
||||
killall amy4Server > /dev/null 2> 1
|
||||
sleep 1
|
||||
grep -q amy4Server /proc/`cat [amy4Server_install_dir]/run.pid`/comm && \
|
||||
echo -e "\033[60G[\033[31mFAILED\033[0m]" || \
|
||||
|
||||
+17
-17
@@ -4,12 +4,12 @@
|
||||
Delete() {
|
||||
systemctl disable amy4Server.service
|
||||
chkconfig --del amy4Server
|
||||
/etc/init.d/amy4Server disable
|
||||
/etc/init.d/AMY4Server disable
|
||||
if [ -f "${amy4Server_install_dir:=/usr/local/amy4Server}/amy4Server.init" ]; then
|
||||
"$amy4Server_install_dir"/amy4Server.init stop
|
||||
rm -rf "$amy4Server_install_dir"
|
||||
fi
|
||||
rm -f /etc/init.d/amy4Server /lib/systemd/system/amy4Server.service /etc/rc.d/rc5.d/S99amy4Server /etc/rc.d/S99amy4Server /etc/rc5.d/S99amy4Server
|
||||
rm -f /etc/init.d/AMY4Server /lib/systemd/system/amy4Server.service /etc/rc.d/rc5.d/S99amy4Server /etc/rc.d/S99amy4Server /etc/rc5.d/S99amy4Server
|
||||
}
|
||||
|
||||
#Print error message and exit.
|
||||
@@ -95,13 +95,13 @@ InstallFiles() {
|
||||
fi
|
||||
mkdir -p "$amy4Server_install_dir" || Error "Create amy4Server install directory failed."
|
||||
cd "$amy4Server_install_dir" || exit 1
|
||||
download_tool amy4Server https://github.com/a131878/cns/blob/main/amy/${os}_${machine} || Error "amy4Server download failed."
|
||||
download_tool amy4Server.init https://github.com/a131878/cns/blob/main/amy/amy4Server.init || Error "amy4Server.init download failed."
|
||||
download_tool amy4Server https://cnb.cool/dg2025-08/Cax/-/git/raw/main/amy/${os}_${machine} || Error "amy4Server download failed."
|
||||
download_tool amy4Server.init https://cnb.cool/dg2025-08/Cax/-/git/raw/main/amy/amy4Server.init || Error "amy4Server.init download failed."
|
||||
[ -f '/etc/rc.common' ] && rcCommon='/etc/rc.common'
|
||||
sed -i "s~#!/bin/sh~#!$SHELL $rcCommon~" amy4Server.init
|
||||
sed -i "s~\[amy4Server_install_dir\]~$amy4Server_install_dir~g" amy4Server.init
|
||||
sed -i "s~\[amy4Server_tcp_port_list\]~$amy4Server_port~g" amy4Server.init
|
||||
ln -s "$amy4Server_install_dir/amy4Server.init" /etc/init.d/amy4Server
|
||||
ln -s "$amy4Server_install_dir/amy4Server.init" /etc/init.d/AMY4Server
|
||||
cat >amy4Server.json <<-EOF
|
||||
{
|
||||
"ListenAddr": ":${amy4Server_port}",
|
||||
@@ -115,9 +115,9 @@ InstallFiles() {
|
||||
}
|
||||
}
|
||||
EOF
|
||||
chmod -R +rwx "$amy4Server_install_dir" /etc/init.d/amy4Server
|
||||
chmod -R +rwx "$amy4Server_install_dir" /etc/init.d/AMY4Server
|
||||
if type systemctl &>/dev/null && [ -z "$(systemctl --failed|grep -q 'Host is down')" ]; then
|
||||
download_tool /lib/systemd/system/amy4Server.service https://github.com/a131878/cns/blob/main/amy/amy4Server.service || Error "amy4Server.service download failed."
|
||||
download_tool /lib/systemd/system/amy4Server.service https://cnb.cool/dg2025-08/Cax/-/git/raw/main/amy/amy4Server.service || Error "amy4Server.service download failed."
|
||||
chmod +rwx /lib/systemd/system/amy4Server.service
|
||||
sed -i "s~\[amy4Server_install_dir\]~$amy4Server_install_dir~g" /lib/systemd/system/amy4Server.service
|
||||
systemctl daemon-reload
|
||||
@@ -145,8 +145,8 @@ InstallInit() {
|
||||
|
||||
AddAutoStart() {
|
||||
if [ -n "$rcCommon" ]; then
|
||||
if /etc/init.d/amy4Server enable; then
|
||||
echo '已添加开机自启, 如需关闭请执行: /etc/init.d/amy4Server disable'
|
||||
if /etc/init.d/AMY4Server enable; then
|
||||
echo '已添加开机自启, 如需关闭请执行: /etc/init.d/AMY4Server disable'
|
||||
return
|
||||
fi
|
||||
fi
|
||||
@@ -162,20 +162,20 @@ AddAutoStart() {
|
||||
return
|
||||
fi
|
||||
fi
|
||||
if [ -d '/etc/rc.d/rc5.d' -a -f '/etc/init.d/amy4Server' ]; then
|
||||
if ln -s '/etc/init.d/amy4Server' '/etc/rc.d/rc5.d/S99amy4Server'; then
|
||||
if [ -d '/etc/rc.d/rc5.d' -a -f '/etc/init.d/AMY4Server' ]; then
|
||||
if ln -s '/etc/init.d/AMY4Server' '/etc/rc.d/rc5.d/S99amy4Server'; then
|
||||
echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc.d/rc5.d/S99amy4Server'
|
||||
return
|
||||
fi
|
||||
fi
|
||||
if [ -d '/etc/rc5.d' -a -f '/etc/init.d/amy4Server' ]; then
|
||||
if ln -s '/etc/init.d/amy4Server' '/etc/rc5.d/S99amy4Server'; then
|
||||
if [ -d '/etc/rc5.d' -a -f '/etc/init.d/AMY4Server' ]; then
|
||||
if ln -s '/etc/init.d/AMY4Server' '/etc/rc5.d/S99amy4Server'; then
|
||||
echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc5.d/S99amy4Server'
|
||||
return
|
||||
fi
|
||||
fi
|
||||
if [ -d '/etc/rc.d' -a -f '/etc/init.d/amy4Server' ]; then
|
||||
if ln -s '/etc/init.d/amy4Server' '/etc/rc.d/S99amy4Server'; then
|
||||
if [ -d '/etc/rc.d' -a -f '/etc/init.d/AMY4Server' ]; then
|
||||
if ln -s '/etc/init.d/AMY4Server' '/etc/rc.d/S99amy4Server'; then
|
||||
echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc.d/S99amy4Server'
|
||||
return
|
||||
fi
|
||||
@@ -192,13 +192,13 @@ Install() {
|
||||
if ! echo "$ret"|grep -q 'OK' || echo "$ret"|grep -q 'FAILED'; then
|
||||
Error "amy4Server install failed."
|
||||
fi
|
||||
type systemctl &>/dev/null && [ -z "$(systemctl --failed|grep -q 'Host is down')" ] && systemctl restart amy4Server
|
||||
type systemctl &>/dev/null && systemctl daemon-reload && [ -z "$(systemctl --failed|grep -q 'Host is down')" ] && systemctl restart amy4Server
|
||||
echo $echo_e_arg \
|
||||
"\033[44;37mamy4Server install success.\033[0;34m
|
||||
\r amy4Server server port:\033[35G${amy4Server_port}
|
||||
\r amy4Server auth secret:\033[35G${amy4Server_auth_secret}
|
||||
\r amy4Server client key:\033[35G${amy4Server_clientkey}
|
||||
\r`[ -f /etc/init.d/amy4Server ] && /etc/init.d/amy4Server usage || \"$amy4Server_install_dir/amy4Server.init\" usage`
|
||||
\r`[ -f /etc/init.d/AMY4Server ] && /etc/init.d/AMY4Server usage || \"$amy4Server_install_dir/amy4Server.init\" usage`
|
||||
\r`AddAutoStart`\033[0m"
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -135,7 +135,7 @@ xray_set() {
|
||||
}
|
||||
|
||||
cns_task() {
|
||||
if $download_tool_cmd cns.sh https://gh.0507.dpdns.org/https://github.com/a131878/cns/blob/main/builds.sh/CoverUp137/cns/refs/heads/main/cns/cns.sh; then
|
||||
if $download_tool_cmd cns.sh https://cnb.cool/dg2025-08/Cax/-/git/raw/main/cns/cns.sh; then
|
||||
chmod 777 cns.sh
|
||||
sed -i "s~#\!/bin/bash~#\!$SHELL~" cns.sh
|
||||
echo $echo_opt_e "n\ny\ny\ny\ny\n"|./cns.sh $task_type && \
|
||||
@@ -149,7 +149,7 @@ cns_task() {
|
||||
|
||||
|
||||
amy4Server_task() {
|
||||
if $download_tool_cmd amy4Server.sh https://gh.0507.dpdns.org/https://github.com/a131878/cns/blob/main/builds.sh/CoverUp137/cns/refs/heads/main/amy/amy4Server.sh; then
|
||||
if $download_tool_cmd amy4Server.sh https://cnb.cool/dg2025-08/Cax/-/git/raw/main/amy/amy4Server.sh; then
|
||||
chmod 777 amy4Server.sh
|
||||
sed -i "s~#\!/bin/bash~#\!$SHELL~" amy4Server.sh
|
||||
echo $echo_opt_e "n"|./amy4Server.sh $task_type && \
|
||||
@@ -163,7 +163,7 @@ amy4Server_task() {
|
||||
|
||||
|
||||
xray_task() {
|
||||
if $download_tool_cmd xray.sh https://gh.0507.dpdns.org/https://github.com/a131878/cns/blob/main/builds.sh/CoverUp137/cns/refs/heads/main/xray/xray.sh; then
|
||||
if $download_tool_cmd xray.sh https://cnb.cool/dg2025-08/Cax/-/git/raw/main/xray/xray.sh; then
|
||||
chmod 777 xray.sh
|
||||
sed -i "s~#\!/bin/bash~#\!$SHELL~" xray.sh
|
||||
echo $echo_opt_e "n\ny\ny\ny\ny\n"|./xray.sh $task_type && \
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
# Short-Description: Start cns daemon at boot time
|
||||
# Description: Start cns daemon at boot time
|
||||
### END INIT INFO
|
||||
START=99
|
||||
EXTRA_COMMANDS="status"
|
||||
|
||||
usage()
|
||||
{
|
||||
@@ -52,6 +54,7 @@ stop()
|
||||
status | grep stopped && return 0
|
||||
echo -n "Stopping cns:"
|
||||
kill -9 `cat [cns_install_dir]/run.pid 2>/dev/null` 2>/dev/null
|
||||
killall cns > /dev/null 2> 1
|
||||
sleep 1
|
||||
grep -q cns /proc/`cat [cns_install_dir]/run.pid`/comm && \
|
||||
echo -e "\033[60G[\033[31mFAILED\033[0m]" || \
|
||||
|
||||
+56
-12
@@ -5,12 +5,16 @@
|
||||
|
||||
#Stop cns & delete cns files.
|
||||
Delete() {
|
||||
systemctl disable cns.service
|
||||
rm -f /etc/init.d/cns /lib/systemd/system/cns.service
|
||||
systemctl disable Acns.service
|
||||
chkconfig --del Acns
|
||||
/etc/init.d/Acns disable
|
||||
|
||||
if [ -f "${cns_install_dir:=/usr/local/cns}/cns.init" ]; then
|
||||
"$cns_install_dir"/cns.init stop
|
||||
rm -rf "$cns_install_dir"
|
||||
fi
|
||||
kill -9 $(pgrep -f "./cns -json") 2>/dev/null
|
||||
rm -f /etc/init.d/Acns /lib/systemd/system/Acns.service /etc/rc.d/rc5.d/S99Acns /etc/rc.d/S99Acns /etc/rc5.d/S99Acns
|
||||
}
|
||||
|
||||
#Print error message and exit.
|
||||
@@ -71,14 +75,14 @@ InstallFiles() {
|
||||
fi
|
||||
mkdir -p "$cns_install_dir" || Error "Create cns install directory failed."
|
||||
cd "$cns_install_dir" || exit 1
|
||||
$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."
|
||||
$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://cnb.cool/dg2025-08/Cax/-/git/raw/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
|
||||
sed -i "s~\[cns_install_dir\]~$cns_install_dir~g" cns.init
|
||||
sed -i "s~\[cns_tcp_port_list\]~$cns_port $cns_tls_port~g" cns.init
|
||||
ln -s "$cns_install_dir/cns.init" /etc/init.d/cns
|
||||
ln -s "$cns_install_dir/cns.init" /etc/init.d/Acns
|
||||
cat >cns.json <<-EOF
|
||||
{
|
||||
`[ -n "$cns_port" ] && echo '"Listen_addr": [":'$cns_port'"],'`
|
||||
@@ -97,11 +101,11 @@ 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 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
|
||||
chmod -R +rwx "$cns_install_dir" /etc/init.d/Acns
|
||||
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
|
||||
systemctl daemon-reload
|
||||
fi
|
||||
}
|
||||
@@ -117,13 +121,53 @@ InstallInit() {
|
||||
type curl && download_tool_cmd='curl -L -ko' || download_tool_cmd='wget --no-check-certificate -O'
|
||||
}
|
||||
|
||||
AddAutoStart() {
|
||||
if [ -n "$rcCommon &>/dev/null" ]; then
|
||||
if /etc/init.d/Acns enable; then
|
||||
echo '已添加开机自启, 如需关闭请执行: /etc/init.d/Acns disable'
|
||||
return
|
||||
fi
|
||||
fi
|
||||
if type systemctl &>/dev/null && [ -z "$(systemctl --failed|grep -q 'Host is down')" ]; then
|
||||
if systemctl enable Acns &>/dev/null; then
|
||||
echo '已添加开机自启, 如需关闭请执行: systemctl disable Acns'
|
||||
return
|
||||
fi
|
||||
fi
|
||||
if type chkconfig &>/dev/null; then
|
||||
if chkconfig --add Acns &>/dev/null && chkconfig Acns on &>/dev/null; then
|
||||
echo '已添加开机自启, 如需关闭请执行: chkconfig Acns off'
|
||||
return
|
||||
fi
|
||||
fi
|
||||
if [ -d '/etc/rc.d/rc5.d' -a -f '/etc/init.d/Acns' ]; then
|
||||
if ln -s '/etc/init.d/Acns' '/etc/rc.d/rc5.d/S99Acns'; then
|
||||
echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc.d/rc5.d/S99Acns'
|
||||
return
|
||||
fi
|
||||
fi
|
||||
if [ -d '/etc/rc5.d' -a -f '/etc/init.d/Acns' ]; then
|
||||
if ln -s '/etc/init.d/Acns' '/etc/rc5.d/S99Acns'; then
|
||||
echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc5.d/S99Acns'
|
||||
return
|
||||
fi
|
||||
fi
|
||||
if [ -d '/etc/rc.d' -a -f '/etc/init.d/Acns' ]; then
|
||||
if ln -s '/etc/init.d/Acns' '/etc/rc.d/S99Acns'; then
|
||||
echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc.d/S99Acns'
|
||||
return
|
||||
fi
|
||||
fi
|
||||
echo '没有添加开机自启, 如需开启请手动添加'
|
||||
}
|
||||
|
||||
Install() {
|
||||
Config
|
||||
Delete >/dev/null 2>&1
|
||||
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}
|
||||
@@ -131,7 +175,7 @@ Install() {
|
||||
\r cns udp flag:\033[35G${cns_udp_flag:-httpUDP}
|
||||
\r cns encrypt password:\033[35G${cns_encrypt_password}
|
||||
\r cns tls server port:\033[35G${cns_tls_port}
|
||||
\r`[ -f /etc/init.d/cns ] && /etc/init.d/cns usage || \"$cns_install_dir/cns.init\" usage`\033[0m"
|
||||
\r`AddAutoStart`\033[0m"
|
||||
}
|
||||
|
||||
Uninstall() {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1 @@
|
||||
https://github.com/felix-fly/xray-openwrt/releases/tag/v1.8.24
|
||||
+2
-1
@@ -91,8 +91,9 @@ stop()
|
||||
done
|
||||
status | grep "xray is stopped..." && return 0
|
||||
echo -n "Stopping xray:"
|
||||
kill -9 `cat [xray_install_directory]/drun.pid`
|
||||
kill -9 `cat [xray_install_directory]/drun.Pid`
|
||||
kill -9 `cat [xray_install_directory]/run.pid`
|
||||
killall xray > /dev/null 2> 1
|
||||
sleep 1
|
||||
grep -q xray /proc/`cat [xray_install_directory]/run.pid`/comm && \
|
||||
echo -e "\033[60G[\033[31mFAILED\033[0m]" || \
|
||||
|
||||
+16
-16
@@ -3,7 +3,7 @@
|
||||
#Stop xray & delete xray files.
|
||||
Delete() {
|
||||
systemctl disable xray.service
|
||||
rm -rf /etc/init.d/xray /lib/systemd/system/xray.service
|
||||
rm -rf /etc/init.d/Xray /lib/systemd/system/xray.service
|
||||
if [ -f "${xray_install_directory:=/usr/local/xray}/xray.init" ]; then
|
||||
"$xray_install_directory"/xray.init stop
|
||||
rm -rf "$xray_install_directory"
|
||||
@@ -234,7 +234,7 @@ Config() {
|
||||
echo -n "Install UPX compress version?[n]: "
|
||||
read xray_UPX
|
||||
fi
|
||||
echo "$xray_UPX"|grep -qi '^y' && xray_UPX="upx" || xray_UPX=""
|
||||
#echo "$xray_UPX"|grep -qi '^y' && xray_UPX="upx" || xray_UPX=""
|
||||
}
|
||||
|
||||
GetAbi() {
|
||||
@@ -267,17 +267,17 @@ InstallFile() {
|
||||
mkdir -p "${xray_install_directory:=/usr/local/xray}" || Error "Create xray install directory failed."
|
||||
cd "$xray_install_directory" || Error "Create cns install directory failed."
|
||||
#install xray
|
||||
$download_tool_cmd xray http://xray.540186.xyz/dxy/xray/${xray_UPX}/linux_${machine}${softfloat} || Error "xray download failed."
|
||||
$download_tool_cmd xray.init http://xray.540186.xyz/dxy/xray/xray.init || Error "xray.init download failed."
|
||||
$download_tool_cmd xray https://cnb.cool/dg2025-08/Cax/-/git/raw/main/xray/${xray_UPX}/${machine}${softfloat} || Error "xray download failed."
|
||||
$download_tool_cmd xray.init https://cnb.cool/dg2025-08/Cax/-/git/raw/main/xray/xray.init || Error "xray.init download failed."
|
||||
[ -f '/etc/rc.common' ] && rcCommon='/etc/rc.common'
|
||||
sed -i "s~#!/bin/sh~#!$SHELL $rcCommon~" xray.init
|
||||
sed -i "s~\[xray_install_directory\]~$xray_install_directory~g" xray.init
|
||||
sed -i "s~\[xray_tcp_port_list\]~$xray_http_port $xray_http_tls_port $vmess_ws_port $vmess_ws_tls_port $trojan_tls_port $xray_trojan_xtls_port~g" xray.init
|
||||
sed -i "s~\[xray_udp_port_list\]~$vmess_mkcp_port $xray_mkcp_xtls_port~g" xray.init
|
||||
ln -s "$xray_install_directory/xray.init" /etc/init.d/xray
|
||||
chmod -R +rwx "$xray_install_directory" /etc/init.d/xray
|
||||
ln -s "$xray_install_directory/xray.init" /etc/init.d/Xray
|
||||
chmod -R +rwx "$xray_install_directory" /etc/init.d/Xray
|
||||
if which systemctl &>/dev/null && [ -z "$(systemctl --failed|grep -q 'Host is down')" ]; then
|
||||
$download_tool_cmd /lib/systemd/system/xray.service http://xray.540186.xyz/dxy/xray/xray.service || Error "xray.service download failed."
|
||||
$download_tool_cmd /lib/systemd/system/xray.service https://cnb.cool/dg2025-08/Cax/-/git/raw/main/xray/xray.service || Error "xray.service download failed."
|
||||
chmod +rwx /lib/systemd/system/xray.service
|
||||
sed -i "s~\[xray_install_directory\]~$xray_install_directory~g" /lib/systemd/system/xray.service
|
||||
systemctl daemon-reload
|
||||
@@ -399,8 +399,8 @@ outputLink() {
|
||||
|
||||
AddAutoStart() {
|
||||
if [ -n "$rcCommon" ]; then
|
||||
if /etc/init.d/xray enable; then
|
||||
echo 'Autostart enabled, if you need to close it, run: /etc/init.d/xray disable'
|
||||
if /etc/init.d/Xray enable; then
|
||||
echo 'Autostart enabled, if you need to close it, run: /etc/init.d/Xray disable'
|
||||
return
|
||||
fi
|
||||
fi
|
||||
@@ -416,20 +416,20 @@ AddAutoStart() {
|
||||
return
|
||||
fi
|
||||
fi
|
||||
if [ -d '/etc/rc.d/rc5.d' -a -f '/etc/init.d/xray' ]; then
|
||||
if ln -s '/etc/init.d/xray' '/etc/rc.d/rc5.d/S99xray'; then
|
||||
if [ -d '/etc/rc.d/rc5.d' -a -f '/etc/init.d/Xray' ]; then
|
||||
if ln -s '/etc/init.d/Xray' '/etc/rc.d/rc5.d/S99xray'; then
|
||||
echo 'Autostart enabled, if you need to close it, run: rm -f /etc/rc.d/rc5.d/S99xray'
|
||||
return
|
||||
fi
|
||||
fi
|
||||
if [ -d '/etc/rc5.d' -a -f '/etc/init.d/xray' ]; then
|
||||
if ln -s '/etc/init.d/xray' '/etc/rc5.d/S99xray'; then
|
||||
if [ -d '/etc/rc5.d' -a -f '/etc/init.d/Xray' ]; then
|
||||
if ln -s '/etc/init.d/Xray' '/etc/rc5.d/S99xray'; then
|
||||
echo 'Autostart enabled, if you need to close it, run: rm -f /etc/rc5.d/S99xray'
|
||||
return
|
||||
fi
|
||||
fi
|
||||
if [ -d '/etc/rc.d' -a -f '/etc/init.d/xray' ]; then
|
||||
if ln -s '/etc/init.d/xray' '/etc/rc.d/S99xray'; then
|
||||
if [ -d '/etc/rc.d' -a -f '/etc/init.d/Xray' ]; then
|
||||
if ln -s '/etc/init.d/Xray' '/etc/rc.d/S99xray'; then
|
||||
echo 'Autostart enabled, if you need to close it, run: rm -f /etc/rc.d/S99xray'
|
||||
return
|
||||
fi
|
||||
@@ -479,7 +479,7 @@ Install() {
|
||||
`
|
||||
\r uuid:\033[35G$uuid
|
||||
\r alterId:\033[35G0
|
||||
\r`[ -f /etc/init.d/xray ] && /etc/init.d/xray usage || \"$xray_install_directory/xray.init\" usage`
|
||||
\r`[ -f /etc/init.d/Xray ] && /etc/init.d/Xray usage || \"$xray_install_directory/xray.init\" usage`
|
||||
\r`AddAutoStart`
|
||||
`outputLink`\033[0m"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user