Skip to content

Commit 4d1279d

Browse files
committed
fix caddy run
1 parent d999705 commit 4d1279d

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

@@ -111,6 +122,12 @@ else
111122
fi
112123
if [[ -f $is_caddy_bin && -d $is_caddy_dir && $is_caddy_service ]]; then
113124
is_caddy=1
125+
# fix caddy run; ver >= 2.8.2
126+
[[ ! $(grep '\-\-adapter caddyfile' /lib/systemd/system/caddy.service) ]] && {
127+
load systemd.sh
128+
install_service caddy
129+
systemctl restart caddy &
130+
}
114131
is_caddy_ver=$($is_caddy_bin version | head -n1 | cut -d " " -f1)
115132
if [[ $(pgrep -f $is_caddy_bin) ]]; then
116133
is_caddy_status=$(_green running)
@@ -120,17 +137,6 @@ if [[ -f $is_caddy_bin && -d $is_caddy_dir && $is_caddy_service ]]; then
120137
fi
121138
fi
122139

123-
# load bash script.
124-
load() {
125-
. $is_sh_dir/src/$1
126-
}
127-
128-
# wget add --no-check-certificate
129-
_wget() {
130-
# [[ $proxy ]] && export https_proxy=$proxy
131-
wget --no-check-certificate "$@"
132-
}
133-
134140
load core.sh
135141
# old sh ver
136142
is_old_dir=/etc/v2ray/233boy

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

v2ray.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=v4.19
4+
is_sh_ver=v4.20
55

66
. /etc/v2ray/sh/src/init.sh

0 commit comments

Comments
 (0)