fix no-auto-tls err
This commit is contained in:
@@ -525,7 +525,7 @@ change() {
|
|||||||
1)
|
1)
|
||||||
# new port
|
# new port
|
||||||
is_new_port=$3
|
is_new_port=$3
|
||||||
[[ $host && ! $is_caddy ]] && err "($is_config_file) 不支持更改端口, 因为没啥意义."
|
[[ $host && ! $is_caddy || $is_no_auto_tls ]] && err "($is_config_file) 不支持更改端口, 因为没啥意义."
|
||||||
if [[ $is_new_port && ! $is_auto ]]; then
|
if [[ $is_new_port && ! $is_auto ]]; then
|
||||||
[[ ! $(is_test port $is_new_port) ]] && err "请输入正确的端口, 可选(1-65535)"
|
[[ ! $(is_test port $is_new_port) ]] && err "请输入正确的端口, 可选(1-65535)"
|
||||||
[[ $is_new_port != 443 && $(is_test port_used $is_new_port) ]] && err "无法使用 ($is_new_port) 端口"
|
[[ $is_new_port != 443 && $(is_test port_used $is_new_port) ]] && err "无法使用 ($is_new_port) 端口"
|
||||||
@@ -753,7 +753,7 @@ del() {
|
|||||||
[[ ! $old_host ]] && return # no host exist or not set new host;
|
[[ ! $old_host ]] && return # no host exist or not set new host;
|
||||||
is_del_host=$old_host
|
is_del_host=$old_host
|
||||||
}
|
}
|
||||||
[[ $is_del_host && $host != $old_host ]] && {
|
[[ $is_del_host && $host != $old_host && ! $is_no_auto_tls ]] && {
|
||||||
rm -rf $is_caddy_conf/$is_del_host.conf $is_caddy_conf/$is_del_host.conf.add
|
rm -rf $is_caddy_conf/$is_del_host.conf $is_caddy_conf/$is_del_host.conf.add
|
||||||
[[ ! $is_new_json ]] && manage restart caddy &
|
[[ ! $is_new_json ]] && manage restart caddy &
|
||||||
}
|
}
|
||||||
@@ -993,7 +993,7 @@ add() {
|
|||||||
h2 | ws | grpc)
|
h2 | ws | grpc)
|
||||||
old_host=$host
|
old_host=$host
|
||||||
if [[ ! $is_use_tls ]]; then
|
if [[ ! $is_use_tls ]]; then
|
||||||
host=
|
unset host is_no_auto_tls
|
||||||
else
|
else
|
||||||
[[ $is_old_net == 'grpc' ]] && {
|
[[ $is_old_net == 'grpc' ]] && {
|
||||||
path=/$path
|
path=/$path
|
||||||
@@ -1246,6 +1246,9 @@ get() {
|
|||||||
if [[ $is_caddy && $host && -f $is_caddy_conf/$host.conf ]]; then
|
if [[ $is_caddy && $host && -f $is_caddy_conf/$host.conf ]]; then
|
||||||
is_tmp_https_port=$(grep -E -o "$host:[1-9][0-9]?+" $is_caddy_conf/$host.conf | sed s/.*://)
|
is_tmp_https_port=$(grep -E -o "$host:[1-9][0-9]?+" $is_caddy_conf/$host.conf | sed s/.*://)
|
||||||
fi
|
fi
|
||||||
|
if [[ $host && ! -f $is_caddy_conf/$host.conf ]]; then
|
||||||
|
is_no_auto_tls=1
|
||||||
|
fi
|
||||||
[[ $is_tmp_https_port ]] && is_https_port=$is_tmp_https_port
|
[[ $is_tmp_https_port ]] && is_https_port=$is_tmp_https_port
|
||||||
[[ $is_client && $host ]] && port=$is_https_port
|
[[ $is_client && $host ]] && port=$is_https_port
|
||||||
get protocol $is_protocol-$net
|
get protocol $is_protocol-$net
|
||||||
|
Reference in New Issue
Block a user