Skip to content

Commit 26caca0

Browse files
committed
fix caddy run
1 parent b462cb9 commit 26caca0

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

src/init.sh

+17-11
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@ warn() {
4747
echo -e "\n$is_warn $@\n"
4848
}
4949

50+
# load bash script.
51+
load() {
52+
. $is_sh_dir/src/$1
53+
}
54+
55+
# wget add --no-check-certificate
56+
_wget() {
57+
# [[ $proxy ]] && export https_proxy=$proxy
58+
wget --no-check-certificate "$@"
59+
}
60+
5061
# yum or apt-get
5162
cmd=$(type -P apt-get || type -P yum)
5263

@@ -96,6 +107,12 @@ else
96107
fi
97108
if [[ -f $is_caddy_bin && -d $is_caddy_dir && $is_caddy_service ]]; then
98109
is_caddy=1
110+
# fix caddy run; ver >= 2.8.2
111+
[[ ! $(grep '\-\-adapter caddyfile' /lib/systemd/system/caddy.service) ]] && {
112+
load systemd.sh
113+
install_service caddy
114+
systemctl restart caddy &
115+
}
99116
is_caddy_ver=$($is_caddy_bin version | head -n1 | cut -d " " -f1)
100117
if [[ $(pgrep -f $is_caddy_bin) ]]; then
101118
is_caddy_status=$(_green running)
@@ -105,17 +122,6 @@ if [[ -f $is_caddy_bin && -d $is_caddy_dir && $is_caddy_service ]]; then
105122
fi
106123
fi
107124

108-
# load bash script.
109-
load() {
110-
. $is_sh_dir/src/$1
111-
}
112-
113-
# wget add --no-check-certificate
114-
_wget() {
115-
# [[ $proxy ]] && export https_proxy=$proxy
116-
wget --no-check-certificate "$@"
117-
}
118-
119125
load core.sh
120126
[[ ! $args ]] && args=main
121127
main $args

src/systemd.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ Requires=network-online.target
3939
Type=notify
4040
User=root
4141
Group=root
42-
ExecStart=$is_caddy_bin run --environ --config $is_caddyfile
43-
ExecReload=$is_caddy_bin reload --config $is_caddyfile
42+
ExecStart=$is_caddy_bin run --environ --config $is_caddyfile --adapter caddyfile
43+
ExecReload=$is_caddy_bin reload --config $is_caddyfile --adapter caddyfile
4444
TimeoutStopSec=5s
4545
LimitNPROC=10000
4646
LimitNOFILE=1048576

xray.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

33
args=$@
4-
is_sh_ver=v1.19
4+
is_sh_ver=v1.20
55

66
. /etc/xray/sh/src/init.sh

0 commit comments

Comments
 (0)