Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
67387eb0a1 | ||
![]() |
5c6f48df83 |
@@ -1,6 +1,5 @@
|
||||
caddy_config() {
|
||||
is_caddy_site_file=$is_caddy_conf/${host}.conf
|
||||
[[ ! $tlsport ]] && tlsport=443
|
||||
case $1 in
|
||||
new)
|
||||
mkdir -p $is_caddy_dir $is_caddy_dir/sites $is_caddy_conf
|
||||
|
12
src/core.sh
12
src/core.sh
@@ -372,7 +372,7 @@ create() {
|
||||
api add $is_json_file $is_dynamic_port_link_file &>/dev/null
|
||||
fi
|
||||
# caddy auto tls
|
||||
[[ $is_caddy && $host ]] && {
|
||||
[[ $is_caddy && $host && ! $is_no_auto_tls ]] && {
|
||||
create caddy $net
|
||||
}
|
||||
# restart core
|
||||
@@ -1210,10 +1210,10 @@ get() {
|
||||
is_dynamic_port_range=$(jq -r '.inbounds[0].port' $is_dynamic_port_file)
|
||||
[[ $? != 0 ]] && err "无法读取动态端口文件: $is_dynamic_port"
|
||||
fi
|
||||
if [[ $is_caddy && $host ]]; then
|
||||
tlsport=$(egrep -o "$host:[1-9][0-9]?+" $is_caddy_conf/$host.conf | sed s/.*://)
|
||||
if [[ $is_caddy && $host && -f $is_caddy_conf/$host.conf ]]; then
|
||||
tmp_tlsport=$(egrep -o "$host:[1-9][0-9]?+" $is_caddy_conf/$host.conf | sed s/.*://)
|
||||
fi
|
||||
[[ ! $tlsport ]] && tlsport=443
|
||||
[[ $tmp_tlsport ]] && tlsport=$tmp_tlsport
|
||||
[[ $is_client && $host ]] && port=$tlsport
|
||||
get protocol $is_protocol-$net
|
||||
fi
|
||||
@@ -1383,7 +1383,9 @@ get() {
|
||||
[[ $? != 0 ]] && err "无法生成 Shadowsocks 2022 密码, 请安装 openssl."
|
||||
;;
|
||||
ping)
|
||||
is_host_dns=$(ping $host -c 1 -W 2 | head -1)
|
||||
is_ip_type="-4"
|
||||
[[ $(grep ":" <<<$ip) ]] && is_ip_type="-6"
|
||||
is_host_dns=$(ping $host $is_ip_type -c 1 -W 2 | head -1)
|
||||
;;
|
||||
log | logerr)
|
||||
msg "\n 提醒: 按 $(_green Ctrl + C) 退出\n"
|
||||
|
@@ -83,6 +83,7 @@ is_caddy_repo=caddyserver/caddy
|
||||
is_caddyfile=$is_caddy_dir/Caddyfile
|
||||
is_caddy_conf=$is_caddy_dir/$author
|
||||
is_caddy_service=$(systemctl list-units --full -all | grep caddy.service)
|
||||
tlsport=443
|
||||
|
||||
# core ver
|
||||
is_core_ver=$($is_core_bin version | head -n1 | cut -d " " -f1-2)
|
||||
|
Reference in New Issue
Block a user