fix caddy run

This commit is contained in:
233boy
2024-06-02 17:10:22 +08:00
parent d999705479
commit 4d1279d038
3 changed files with 20 additions and 14 deletions

View File

@@ -47,6 +47,17 @@ warn() {
echo -e "\n$is_warn $@\n" echo -e "\n$is_warn $@\n"
} }
# load bash script.
load() {
. $is_sh_dir/src/$1
}
# wget add --no-check-certificate
_wget() {
# [[ $proxy ]] && export https_proxy=$proxy
wget --no-check-certificate "$@"
}
# yum or apt-get # yum or apt-get
cmd=$(type -P apt-get || type -P yum) cmd=$(type -P apt-get || type -P yum)
@@ -111,6 +122,12 @@ else
fi fi
if [[ -f $is_caddy_bin && -d $is_caddy_dir && $is_caddy_service ]]; then if [[ -f $is_caddy_bin && -d $is_caddy_dir && $is_caddy_service ]]; then
is_caddy=1 is_caddy=1
# fix caddy run; ver >= 2.8.2
[[ ! $(grep '\-\-adapter caddyfile' /lib/systemd/system/caddy.service) ]] && {
load systemd.sh
install_service caddy
systemctl restart caddy &
}
is_caddy_ver=$($is_caddy_bin version | head -n1 | cut -d " " -f1) is_caddy_ver=$($is_caddy_bin version | head -n1 | cut -d " " -f1)
if [[ $(pgrep -f $is_caddy_bin) ]]; then if [[ $(pgrep -f $is_caddy_bin) ]]; then
is_caddy_status=$(_green running) is_caddy_status=$(_green running)
@@ -120,17 +137,6 @@ if [[ -f $is_caddy_bin && -d $is_caddy_dir && $is_caddy_service ]]; then
fi fi
fi fi
# load bash script.
load() {
. $is_sh_dir/src/$1
}
# wget add --no-check-certificate
_wget() {
# [[ $proxy ]] && export https_proxy=$proxy
wget --no-check-certificate "$@"
}
load core.sh load core.sh
# old sh ver # old sh ver
is_old_dir=/etc/v2ray/233boy is_old_dir=/etc/v2ray/233boy

View File

@@ -39,8 +39,8 @@ Requires=network-online.target
Type=notify Type=notify
User=root User=root
Group=root Group=root
ExecStart=$is_caddy_bin run --environ --config $is_caddyfile ExecStart=$is_caddy_bin run --environ --config $is_caddyfile --adapter caddyfile
ExecReload=$is_caddy_bin reload --config $is_caddyfile ExecReload=$is_caddy_bin reload --config $is_caddyfile --adapter caddyfile
TimeoutStopSec=5s TimeoutStopSec=5s
LimitNPROC=10000 LimitNPROC=10000
LimitNOFILE=1048576 LimitNOFILE=1048576

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
args=$@ args=$@
is_sh_ver=v4.19 is_sh_ver=v4.20
. /etc/v2ray/sh/src/init.sh . /etc/v2ray/sh/src/init.sh