Skip to content

Commit

Permalink
fix caddy run
Browse files Browse the repository at this point in the history
  • Loading branch information
233boy committed Jun 2, 2024
1 parent b462cb9 commit 26caca0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
28 changes: 17 additions & 11 deletions src/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ warn() {
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
cmd=$(type -P apt-get || type -P yum)

Expand Down Expand Up @@ -96,6 +107,12 @@ else
fi
if [[ -f $is_caddy_bin && -d $is_caddy_dir && $is_caddy_service ]]; then
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)
if [[ $(pgrep -f $is_caddy_bin) ]]; then
is_caddy_status=$(_green running)
Expand All @@ -105,17 +122,6 @@ if [[ -f $is_caddy_bin && -d $is_caddy_dir && $is_caddy_service ]]; then
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
[[ ! $args ]] && args=main
main $args
4 changes: 2 additions & 2 deletions src/systemd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Requires=network-online.target
Type=notify
User=root
Group=root
ExecStart=$is_caddy_bin run --environ --config $is_caddyfile
ExecReload=$is_caddy_bin reload --config $is_caddyfile
ExecStart=$is_caddy_bin run --environ --config $is_caddyfile --adapter caddyfile
ExecReload=$is_caddy_bin reload --config $is_caddyfile --adapter caddyfile
TimeoutStopSec=5s
LimitNPROC=10000
LimitNOFILE=1048576
Expand Down
2 changes: 1 addition & 1 deletion xray.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

args=$@
is_sh_ver=v1.19
is_sh_ver=v1.20

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

0 comments on commit 26caca0

Please sign in to comment.