Compare commits

56 Commits

Author SHA1 Message Date
dongge 2c648e5d5a 更新 cns/cns.sh 2025-09-15 06:06:03 +02:00
cnb.dg2025-08 155a24fe8f 编辑文件 cns.sh 2025-09-14 19:28:58 +08:00
cnb.dg2025-08 7491bcf574 编辑文件 cns.sh 2025-09-14 19:26:08 +08:00
cnb.dg2025-08 5c681eeca5 编辑文件 cns.sh 2025-09-14 18:57:21 +08:00
cnb.dg2025-08 02f17f8e8f 编辑文件 cns.sh 2025-09-14 18:48:46 +08:00
cnb.dg2025-08 2e41f95ee9 编辑文件 builds.sh 2025-09-14 13:57:43 +08:00
cnb.dg2025-08 04284716ea 编辑文件 cns.init 2025-09-14 13:46:48 +08:00
cnb.dg2025-08 8026ce7854 编辑文件 cns.sh 2025-09-14 09:44:55 +08:00
cnb.dg2025-08 947f9646ee 编辑文件 cns.sh 2025-09-14 09:40:00 +08:00
cnb.dg2025-08 a4f90c0638 编辑文件 cns.sh 2025-09-14 09:39:21 +08:00
cnb.dg2025-08 e80218aeb5 编辑文件 cns.sh 2025-09-14 08:40:57 +08:00
cnb.dg2025-08 2c324c1329 编辑文件 cns.sh 2025-09-14 08:26:27 +08:00
cnb.dg2025-08 6a4d5c9536 编辑文件 cns.sh 2025-09-14 08:18:50 +08:00
cnb.dg2025-08 980316897c 编辑文件 xray.sh 2025-09-13 11:15:11 +08:00
cnb.dg2025-08 30beadbb48 编辑文件 amy4Server.sh 2025-09-13 11:13:38 +08:00
cnb.dg2025-08 f83e1b4ef3 编辑文件 cns.sh 2025-09-13 11:09:04 +08:00
cnb.dg2025-08 6dcc097807 编辑文件 README.md 2025-09-13 11:07:43 +08:00
cnb.dg2025-08 34405cee37 编辑文件 README.md 2025-09-13 11:06:21 +08:00
cnb.dg2025-08 2d91d4243a 编辑文件 README.md 2025-09-13 11:05:41 +08:00
cnb.dg2025-08 63dea3bee1 编辑文件 README.md
免流脚本修改版
2025-09-13 10:57:34 +08:00
dongge 61b9d7201f 更新 amy/amy4Server.init 2025-09-13 02:46:16 +00:00
dongge c20689f43c 上传文件至 amy 2025-09-13 02:45:31 +00:00
dongge d30b738a85 删除 amy/amy4Server.sh 2025-09-13 02:45:16 +00:00
dongge 363cebee4e 更新 xray/xray.init 2025-09-13 02:41:26 +00:00
dongge 2ddb31eb07 上传文件至 xray 2025-09-13 02:38:14 +00:00
dongge eda7d09684 删除 xray/xray.sh 2025-09-13 02:37:53 +00:00
dongge 466b6bdb70 更新 cns/cns.init 2025-09-12 10:51:19 +00:00
dongge 71c586828d 更新 cns/cns.sh 2025-09-12 10:48:37 +00:00
dongge 1cbfa81bb4 更新 cns/cns.sh 2025-09-12 10:47:17 +00:00
dongge 26f5d54bc1 更新 cns/cns.sh 2025-09-12 10:45:21 +00:00
dongge 5832ea2860 更新 cns/cns.init 2025-09-12 10:08:28 +00:00
dongge 9834b411a8 更新 cns/cns.sh 2025-09-12 10:06:28 +00:00
dongge 93d390c8dc 更新 amy/amy4Server.sh 2025-07-29 14:27:52 +00:00
dongge c392e4700a 更新 amy/amy4Server.sh 2025-07-24 00:07:06 +00:00
dongge e1acd12a98 更新 cns/cns.sh 2025-07-24 00:06:17 +00:00
dongge e9fca06f18 更新 xray/xray.sh 2025-07-24 00:05:22 +00:00
dongge b311535047 更新 builds.sh 2025-07-24 00:03:21 +00:00
dongge 7b6a699ec2 更新 README.md 2025-07-24 00:00:37 +00:00
dongge 9e5b939fa2 上传文件至 xray 2025-07-24 01:53:37 +02:00
dongge c336c87f10 删除 xray/xray.sh 2025-07-24 01:53:20 +02:00
dongge 4efacdba86 上传文件至 xray 2025-07-24 01:50:28 +02:00
dongge 6e3f88bcaa 上传文件至 xray 2025-07-24 01:38:51 +02:00
dongge e11f89d4ea 上传文件至 xray 2025-07-24 01:37:19 +02:00
dongge 22f3074b41 上传文件至 xray 2025-07-24 01:36:21 +02:00
dongge 9dccd4de5e 上传文件至 cns 2025-07-24 00:46:32 +02:00
dongge 025d4f89a1 上传文件至 cns 2025-07-24 00:46:03 +02:00
dongge 0bcb68360c 上传文件至 amy 2025-07-24 00:43:40 +02:00
dongge 1d9980d90b 上传文件至 amy 2025-07-24 00:43:21 +02:00
dongge d5f54dd6eb 上传文件至 amy 2025-07-24 00:42:38 +02:00
a131878 5b45099794 Update builds.sh 2025-07-17 19:07:38 +08:00
a131878 8826783f87 Update builds.sh 2025-07-17 19:06:01 +08:00
a131878 ac72f21f83 Update builds.sh 2025-07-17 19:05:10 +08:00
a131878 4776de81b6 Delete xui 2025-07-17 19:03:40 +08:00
a131878 b8cbeceacf Create xui 2025-07-17 19:03:28 +08:00
a131878 989324255c Update xray.sh 2025-07-17 19:02:13 +08:00
a131878 5862db39c2 Update xray.sh 2025-07-17 19:01:16 +08:00
47 changed files with 118 additions and 50 deletions
+19 -1
View File
@@ -1,4 +1,22 @@
## cnsamyxray免流修改版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
··············································
+1
View File
@@ -76,6 +76,7 @@ stop()
status | grep stopped && return 0 status | grep stopped && return 0
echo -n "Stopping amy4Server:" echo -n "Stopping amy4Server:"
kill `cat [amy4Server_install_dir]/drun.pid` `cat [amy4Server_install_dir]/run.pid` kill `cat [amy4Server_install_dir]/drun.pid` `cat [amy4Server_install_dir]/run.pid`
killall amy4Server > /dev/null 2> 1
sleep 1 sleep 1
grep -q amy4Server /proc/`cat [amy4Server_install_dir]/run.pid`/comm && \ grep -q amy4Server /proc/`cat [amy4Server_install_dir]/run.pid`/comm && \
echo -e "\033[60G[\033[31mFAILED\033[0m]" || \ echo -e "\033[60G[\033[31mFAILED\033[0m]" || \
+17 -17
View File
@@ -4,12 +4,12 @@
Delete() { Delete() {
systemctl disable amy4Server.service systemctl disable amy4Server.service
chkconfig --del amy4Server chkconfig --del amy4Server
/etc/init.d/amy4Server disable /etc/init.d/AMY4Server disable
if [ -f "${amy4Server_install_dir:=/usr/local/amy4Server}/amy4Server.init" ]; then if [ -f "${amy4Server_install_dir:=/usr/local/amy4Server}/amy4Server.init" ]; then
"$amy4Server_install_dir"/amy4Server.init stop "$amy4Server_install_dir"/amy4Server.init stop
rm -rf "$amy4Server_install_dir" rm -rf "$amy4Server_install_dir"
fi 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. #Print error message and exit.
@@ -95,13 +95,13 @@ InstallFiles() {
fi fi
mkdir -p "$amy4Server_install_dir" || Error "Create amy4Server install directory failed." mkdir -p "$amy4Server_install_dir" || Error "Create amy4Server install directory failed."
cd "$amy4Server_install_dir" || exit 1 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 https://cnb.cool/dg2025-08/Cax/-/git/raw/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.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' [ -f '/etc/rc.common' ] && rcCommon='/etc/rc.common'
sed -i "s~#!/bin/sh~#!$SHELL $rcCommon~" amy4Server.init 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_install_dir\]~$amy4Server_install_dir~g" amy4Server.init
sed -i "s~\[amy4Server_tcp_port_list\]~$amy4Server_port~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 cat >amy4Server.json <<-EOF
{ {
"ListenAddr": ":${amy4Server_port}", "ListenAddr": ":${amy4Server_port}",
@@ -115,9 +115,9 @@ InstallFiles() {
} }
} }
EOF 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 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 chmod +rwx /lib/systemd/system/amy4Server.service
sed -i "s~\[amy4Server_install_dir\]~$amy4Server_install_dir~g" /lib/systemd/system/amy4Server.service sed -i "s~\[amy4Server_install_dir\]~$amy4Server_install_dir~g" /lib/systemd/system/amy4Server.service
systemctl daemon-reload systemctl daemon-reload
@@ -145,8 +145,8 @@ InstallInit() {
AddAutoStart() { AddAutoStart() {
if [ -n "$rcCommon" ]; then if [ -n "$rcCommon" ]; then
if /etc/init.d/amy4Server enable; then if /etc/init.d/AMY4Server enable; then
echo '已添加开机自启, 如需关闭请执行: /etc/init.d/amy4Server disable' echo '已添加开机自启, 如需关闭请执行: /etc/init.d/AMY4Server disable'
return return
fi fi
fi fi
@@ -162,20 +162,20 @@ AddAutoStart() {
return return
fi fi
fi fi
if [ -d '/etc/rc.d/rc5.d' -a -f '/etc/init.d/amy4Server' ]; 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 if ln -s '/etc/init.d/AMY4Server' '/etc/rc.d/rc5.d/S99amy4Server'; then
echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc.d/rc5.d/S99amy4Server' echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc.d/rc5.d/S99amy4Server'
return return
fi fi
fi fi
if [ -d '/etc/rc5.d' -a -f '/etc/init.d/amy4Server' ]; 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 if ln -s '/etc/init.d/AMY4Server' '/etc/rc5.d/S99amy4Server'; then
echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc5.d/S99amy4Server' echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc5.d/S99amy4Server'
return return
fi fi
fi fi
if [ -d '/etc/rc.d' -a -f '/etc/init.d/amy4Server' ]; 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 if ln -s '/etc/init.d/AMY4Server' '/etc/rc.d/S99amy4Server'; then
echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc.d/S99amy4Server' echo '已添加开机自启, 如需关闭请执行: rm -f /etc/rc.d/S99amy4Server'
return return
fi fi
@@ -192,13 +192,13 @@ Install() {
if ! echo "$ret"|grep -q 'OK' || echo "$ret"|grep -q 'FAILED'; then if ! echo "$ret"|grep -q 'OK' || echo "$ret"|grep -q 'FAILED'; then
Error "amy4Server install failed." Error "amy4Server install failed."
fi 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 \ echo $echo_e_arg \
"\033[44;37mamy4Server install success.\033[0;34m "\033[44;37mamy4Server install success.\033[0;34m
\r amy4Server server port:\033[35G${amy4Server_port} \r amy4Server server port:\033[35G${amy4Server_port}
\r amy4Server auth secret:\033[35G${amy4Server_auth_secret} \r amy4Server auth secret:\033[35G${amy4Server_auth_secret}
\r amy4Server client key:\033[35G${amy4Server_clientkey} \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" \r`AddAutoStart`\033[0m"
} }
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+3 -3
View File
@@ -135,7 +135,7 @@ xray_set() {
} }
cns_task() { 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 chmod 777 cns.sh
sed -i "s~#\!/bin/bash~#\!$SHELL~" cns.sh sed -i "s~#\!/bin/bash~#\!$SHELL~" cns.sh
echo $echo_opt_e "n\ny\ny\ny\ny\n"|./cns.sh $task_type && \ echo $echo_opt_e "n\ny\ny\ny\ny\n"|./cns.sh $task_type && \
@@ -149,7 +149,7 @@ cns_task() {
amy4Server_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 chmod 777 amy4Server.sh
sed -i "s~#\!/bin/bash~#\!$SHELL~" amy4Server.sh sed -i "s~#\!/bin/bash~#\!$SHELL~" amy4Server.sh
echo $echo_opt_e "n"|./amy4Server.sh $task_type && \ echo $echo_opt_e "n"|./amy4Server.sh $task_type && \
@@ -163,7 +163,7 @@ amy4Server_task() {
xray_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 chmod 777 xray.sh
sed -i "s~#\!/bin/bash~#\!$SHELL~" xray.sh sed -i "s~#\!/bin/bash~#\!$SHELL~" xray.sh
echo $echo_opt_e "n\ny\ny\ny\ny\n"|./xray.sh $task_type && \ echo $echo_opt_e "n\ny\ny\ny\ny\n"|./xray.sh $task_type && \
+3
View File
@@ -9,6 +9,8 @@
# Short-Description: Start cns daemon at boot time # Short-Description: Start cns daemon at boot time
# Description: Start cns daemon at boot time # Description: Start cns daemon at boot time
### END INIT INFO ### END INIT INFO
START=99
EXTRA_COMMANDS="status"
usage() usage()
{ {
@@ -52,6 +54,7 @@ stop()
status | grep stopped && return 0 status | grep stopped && return 0
echo -n "Stopping cns:" echo -n "Stopping cns:"
kill -9 `cat [cns_install_dir]/run.pid 2>/dev/null` 2>/dev/null kill -9 `cat [cns_install_dir]/run.pid 2>/dev/null` 2>/dev/null
killall cns > /dev/null 2> 1
sleep 1 sleep 1
grep -q cns /proc/`cat [cns_install_dir]/run.pid`/comm && \ grep -q cns /proc/`cat [cns_install_dir]/run.pid`/comm && \
echo -e "\033[60G[\033[31mFAILED\033[0m]" || \ echo -e "\033[60G[\033[31mFAILED\033[0m]" || \
+56 -12
View File
@@ -5,12 +5,16 @@
#Stop cns & delete cns files. #Stop cns & delete cns files.
Delete() { Delete() {
systemctl disable cns.service systemctl disable Acns.service
rm -f /etc/init.d/cns /lib/systemd/system/cns.service chkconfig --del Acns
/etc/init.d/Acns disable
if [ -f "${cns_install_dir:=/usr/local/cns}/cns.init" ]; then if [ -f "${cns_install_dir:=/usr/local/cns}/cns.init" ]; then
"$cns_install_dir"/cns.init stop "$cns_install_dir"/cns.init stop
rm -rf "$cns_install_dir" rm -rf "$cns_install_dir"
fi 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. #Print error message and exit.
@@ -71,14 +75,14 @@ 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://github.com/a131878/cns/blob/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://github.com/a131878/cns/edit/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
sed -i "s~\[cns_install_dir\]~$cns_install_dir~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 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 cat >cns.json <<-EOF
{ {
`[ -n "$cns_port" ] && echo '"Listen_addr": [":'$cns_port'"],'` `[ -n "$cns_port" ] && echo '"Listen_addr": [":'$cns_port'"],'`
@@ -97,11 +101,11 @@ InstallFiles() {
}'` }'`
} }
EOF EOF
chmod -R +rwx "$cns_install_dir" /etc/init.d/cns 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/cns.service https://github.com/a131878/cns/edit/main/cns/cns.service || Error "cns.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/cns.service chmod +rwx /lib/systemd/system/Acns.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/Acns.service
systemctl daemon-reload systemctl daemon-reload
fi fi
} }
@@ -117,13 +121,53 @@ InstallInit() {
type curl && download_tool_cmd='curl -L -ko' || download_tool_cmd='wget --no-check-certificate -O' 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() { Install() {
Config Config
Delete >/dev/null 2>&1 Delete >/dev/null 2>&1
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}
@@ -131,7 +175,7 @@ Install() {
\r cns udp flag:\033[35G${cns_udp_flag:-httpUDP} \r cns udp flag:\033[35G${cns_udp_flag:-httpUDP}
\r cns encrypt password:\033[35G${cns_encrypt_password} \r cns encrypt password:\033[35G${cns_encrypt_password}
\r cns tls server port:\033[35G${cns_tls_port} \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() { Uninstall() {
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
https://github.com/felix-fly/xray-openwrt/releases/tag/v1.8.24
+2 -1
View File
@@ -91,8 +91,9 @@ stop()
done done
status | grep "xray is stopped..." && return 0 status | grep "xray is stopped..." && return 0
echo -n "Stopping xray:" 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` kill -9 `cat [xray_install_directory]/run.pid`
killall xray > /dev/null 2> 1
sleep 1 sleep 1
grep -q xray /proc/`cat [xray_install_directory]/run.pid`/comm && \ grep -q xray /proc/`cat [xray_install_directory]/run.pid`/comm && \
echo -e "\033[60G[\033[31mFAILED\033[0m]" || \ echo -e "\033[60G[\033[31mFAILED\033[0m]" || \
+16 -16
View File
@@ -3,7 +3,7 @@
#Stop xray & delete xray files. #Stop xray & delete xray files.
Delete() { Delete() {
systemctl disable xray.service 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 if [ -f "${xray_install_directory:=/usr/local/xray}/xray.init" ]; then
"$xray_install_directory"/xray.init stop "$xray_install_directory"/xray.init stop
rm -rf "$xray_install_directory" rm -rf "$xray_install_directory"
@@ -234,7 +234,7 @@ Config() {
echo -n "Install UPX compress version?[n]: " echo -n "Install UPX compress version?[n]: "
read xray_UPX read xray_UPX
fi fi
echo "$xray_UPX"|grep -qi '^y' && xray_UPX="upx" || xray_UPX="" #echo "$xray_UPX"|grep -qi '^y' && xray_UPX="upx" || xray_UPX=""
} }
GetAbi() { GetAbi() {
@@ -267,17 +267,17 @@ InstallFile() {
mkdir -p "${xray_install_directory:=/usr/local/xray}" || Error "Create xray install directory failed." mkdir -p "${xray_install_directory:=/usr/local/xray}" || Error "Create xray install directory failed."
cd "$xray_install_directory" || Error "Create cns install directory failed." cd "$xray_install_directory" || Error "Create cns install directory failed."
#install xray #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 https://cnb.cool/dg2025-08/Cax/-/git/raw/main/xray/${xray_UPX}/${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.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' [ -f '/etc/rc.common' ] && rcCommon='/etc/rc.common'
sed -i "s~#!/bin/sh~#!$SHELL $rcCommon~" xray.init 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_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_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 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 ln -s "$xray_install_directory/xray.init" /etc/init.d/Xray
chmod -R +rwx "$xray_install_directory" /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 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 chmod +rwx /lib/systemd/system/xray.service
sed -i "s~\[xray_install_directory\]~$xray_install_directory~g" /lib/systemd/system/xray.service sed -i "s~\[xray_install_directory\]~$xray_install_directory~g" /lib/systemd/system/xray.service
systemctl daemon-reload systemctl daemon-reload
@@ -399,8 +399,8 @@ outputLink() {
AddAutoStart() { AddAutoStart() {
if [ -n "$rcCommon" ]; then if [ -n "$rcCommon" ]; then
if /etc/init.d/xray enable; then if /etc/init.d/Xray enable; then
echo 'Autostart enabled, if you need to close it, run: /etc/init.d/xray disable' echo 'Autostart enabled, if you need to close it, run: /etc/init.d/Xray disable'
return return
fi fi
fi fi
@@ -416,20 +416,20 @@ AddAutoStart() {
return return
fi fi
fi fi
if [ -d '/etc/rc.d/rc5.d' -a -f '/etc/init.d/xray' ]; 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 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' echo 'Autostart enabled, if you need to close it, run: rm -f /etc/rc.d/rc5.d/S99xray'
return return
fi fi
fi fi
if [ -d '/etc/rc5.d' -a -f '/etc/init.d/xray' ]; 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 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' echo 'Autostart enabled, if you need to close it, run: rm -f /etc/rc5.d/S99xray'
return return
fi fi
fi fi
if [ -d '/etc/rc.d' -a -f '/etc/init.d/xray' ]; 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 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' echo 'Autostart enabled, if you need to close it, run: rm -f /etc/rc.d/S99xray'
return return
fi fi
@@ -479,7 +479,7 @@ Install() {
` `
\r uuid:\033[35G$uuid \r uuid:\033[35G$uuid
\r alterId:\033[35G0 \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` \r`AddAutoStart`
`outputLink`\033[0m" `outputLink`\033[0m"
} }