File tree 3 files changed +20
-14
lines changed
3 files changed +20
-14
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
args=$@
4
- is_sh_ver=v1.01
4
+ is_sh_ver=v1.02
5
5
6
6
. /etc/sing-box/sh/src/init.sh
Original file line number Diff line number Diff line change @@ -47,6 +47,17 @@ warn() {
47
47
echo -e " \n$is_warn $@ \n"
48
48
}
49
49
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
+
50
61
# yum or apt-get
51
62
cmd=$( type -P apt-get || type -P yum)
52
63
@@ -106,6 +117,12 @@ else
106
117
fi
107
118
if [[ -f $is_caddy_bin && -d $is_caddy_dir && $is_caddy_service ]]; then
108
119
is_caddy=1
120
+ # fix caddy run; ver >= 2.8.2
121
+ [[ ! $( grep ' \-\-adapter caddyfile' /lib/systemd/system/caddy.service) ]] && {
122
+ load systemd.sh
123
+ install_service caddy
124
+ systemctl restart caddy &
125
+ }
109
126
is_caddy_ver=$( $is_caddy_bin version | head -n1 | cut -d " " -f1)
110
127
is_tmp_http_port=$( egrep ' ^ {2,}http_port|^http_port' $is_caddyfile | egrep -o [0-9]+)
111
128
is_tmp_https_port=$( egrep ' ^ {2,}https_port|^https_port' $is_caddyfile | egrep -o [0-9]+)
@@ -119,17 +136,6 @@ if [[ -f $is_caddy_bin && -d $is_caddy_dir && $is_caddy_service ]]; then
119
136
fi
120
137
fi
121
138
122
- # load bash script.
123
- load () {
124
- . $is_sh_dir /src/$1
125
- }
126
-
127
- # wget add --no-check-certificate
128
- _wget () {
129
- # [[ $proxy ]] && export https_proxy=$proxy
130
- wget --no-check-certificate " $@ "
131
- }
132
-
133
139
load core.sh
134
140
[[ ! $args ]] && args=main
135
141
main $args
Original file line number Diff line number Diff line change @@ -38,8 +38,8 @@ Requires=network-online.target
38
38
Type=notify
39
39
User=root
40
40
Group=root
41
- ExecStart=$is_caddy_bin run --environ --config $is_caddyfile
42
- ExecReload=$is_caddy_bin reload --config $is_caddyfile
41
+ ExecStart=$is_caddy_bin run --environ --config $is_caddyfile --adapter caddyfile
42
+ ExecReload=$is_caddy_bin reload --config $is_caddyfile --adapter caddyfile
43
43
TimeoutStopSec=5s
44
44
LimitNPROC=10000
45
45
LimitNOFILE=1048576
You can’t perform that action at this time.
0 commit comments