Update v-change-web-domain-backend-tpl

This commit is contained in:
Made I.T 2017-10-23 14:25:24 +02:00 committed by GitHub
commit b40bad31ea

View file

@ -78,29 +78,59 @@ if [ "$backend_type" = "$user" ]; then
for domain in $(shell_list); do for domain in $(shell_list); do
get_domain_values 'web' get_domain_values 'web'
local_ip=$(get_real_ip $IP) local_ip=$(get_real_ip $IP)
prepare_web_domain_values ipv6=$IP6
# Rebuilding vhost # Deleting vhost configuration IPv4
if [ ! -z "$local_ip" ]; then
old=$local_ip
# Deleting proxy
del_web_config "$WEB_SYSTEM" "$TPL.tpl" del_web_config "$WEB_SYSTEM" "$TPL.tpl"
add_web_config "$WEB_SYSTEM" "$TPL.tpl"
if [ "$SSL" = 'yes' ]; then if [ "$SSL" = 'yes' ]; then
del_web_config "$WEB_SYSTEM" "$TPL.stpl" del_web_config "$WEB_SYSTEM" "$TPL.stpl"
fi
if [ ! -z "$PROXY_SYSTEM" ] && [ ! -z "$PROXY" ]; then
del_web_config "$PROXY_SYSTEM" "$PROXY.tpl"
if [ "$SSL" = 'yes' ]; then
del_web_config "$PROXY_SYSTEM" "$PROXY.stpl"
fi
fi
fi
# Deleting vhost configuration IPv6
if [ ! -z "$IP6" ]; then
old=$IP6
del_web_config "$PROXY_SYSTEM" "$PROXY.tpl"
if [ "$SSL" = 'yes' ]; then
del_web_config "$PROXY_SYSTEM" "$PROXY.stpl"
fi
if [ ! -z "$PROXY_SYSTEM" ] && [ ! -z "$PROXY" ]; then
del_web_config "$PROXY_SYSTEM" "$PROXY.tpl"
if [ "$SSL" = 'yes' ]; then
del_web_config "$PROXY_SYSTEM" "$PROXY.stpl"
fi
fi
fi
prepare_web_domain_values
add_web_config "$WEB_SYSTEM" "$TPL.tpl"
if [ "$SSL" = 'yes' ]; then
add_web_config "$WEB_SYSTEM" "$TPL.stpl" add_web_config "$WEB_SYSTEM" "$TPL.stpl"
fi fi
# Rebuilding proxy configuration # Rebuilding proxy configuration
if [ ! -z "$PROXY_SYSTEM" ] && [ ! -z "$PROXY" ]; then if [ ! -z "$PROXY_SYSTEM" ] && [ ! -z "$PROXY" ]; then
del_web_config "$PROXY_SYSTEM" "$PROXY.tpl"
add_web_config "$PROXY_SYSTEM" "$PROXY.tpl" add_web_config "$PROXY_SYSTEM" "$PROXY.tpl"
if [ "$SSL" = 'yes' ]; then if [ "$SSL" = 'yes' ]; then
del_web_config "$PROXY_SYSTEM" "$PROXY.stpl"
add_web_config "$PROXY_SYSTEM" "$PROXY.stpl" add_web_config "$PROXY_SYSTEM" "$PROXY.stpl"
fi fi
fi fi
# Update config # Update config
add_object_key "web" 'DOMAIN' "$domain" 'BACKEND' 'PROXY' add_object_key "web" 'DOMAIN' "$domain_idn" 'BACKEND' 'PROXY'
update_object_value 'web' 'DOMAIN' "$domain" '$BACKEND' "$template" update_object_value 'web' 'DOMAIN' "$domain_idn" '$BACKEND' "$template"
done done
# Chaning template in user config # Chaning template in user config
@ -115,29 +145,61 @@ else
# Parsing domain values # Parsing domain values
get_domain_values 'web' get_domain_values 'web'
local_ip=$(get_real_ip $IP) local_ip=$(get_real_ip $IP)
ipv6=$IP6
# Deleting vhost configuration IPv4
if [ ! -z "$local_ip" ]; then
old=$local_ip
# Deleting proxy
del_web_config "$WEB_SYSTEM" "$TPL.tpl"
if [ "$SSL" = 'yes' ]; then
del_web_config "$WEB_SYSTEM" "$TPL.stpl"
fi
if [ ! -z "$PROXY_SYSTEM" ] && [ ! -z "$PROXY" ]; then
del_web_config "$PROXY_SYSTEM" "$PROXY.tpl"
if [ "$SSL" = 'yes' ]; then
del_web_config "$PROXY_SYSTEM" "$PROXY.stpl"
fi
fi
fi
# Deleting vhost configuration IPv6
if [ ! -z "$IP6" ]; then
old=$IP6
del_web_config "$PROXY_SYSTEM" "$PROXY.tpl"
if [ "$SSL" = 'yes' ]; then
del_web_config "$PROXY_SYSTEM" "$PROXY.stpl"
fi
if [ ! -z "$PROXY_SYSTEM" ] && [ ! -z "$PROXY" ]; then
del_web_config "$PROXY_SYSTEM" "$PROXY.tpl"
if [ "$SSL" = 'yes' ]; then
del_web_config "$PROXY_SYSTEM" "$PROXY.stpl"
fi
fi
fi
prepare_web_domain_values prepare_web_domain_values
# Rebuilding vhost # Rebuilding vhost
del_web_config "$WEB_SYSTEM" "$TPL.tpl"
add_web_config "$WEB_SYSTEM" "$TPL.tpl" add_web_config "$WEB_SYSTEM" "$TPL.tpl"
if [ "$SSL" = 'yes' ]; then if [ "$SSL" = 'yes' ]; then
del_web_config "$WEB_SYSTEM" "$TPL.stpl"
add_web_config "$WEB_SYSTEM" "$TPL.stpl" add_web_config "$WEB_SYSTEM" "$TPL.stpl"
fi fi
# Rebuilding proxy configuration # Rebuilding proxy configuration
if [ ! -z "$PROXY_SYSTEM" ] && [ ! -z "$PROXY" ]; then if [ ! -z "$PROXY_SYSTEM" ] && [ ! -z "$PROXY" ]; then
del_web_config "$PROXY_SYSTEM" "$PROXY.tpl"
add_web_config "$PROXY_SYSTEM" "$PROXY.tpl" add_web_config "$PROXY_SYSTEM" "$PROXY.tpl"
if [ "$SSL" = 'yes' ]; then if [ "$SSL" = 'yes' ]; then
del_web_config "$PROXY_SYSTEM" "$PROXY.stpl"
add_web_config "$PROXY_SYSTEM" "$PROXY.stpl" add_web_config "$PROXY_SYSTEM" "$PROXY.stpl"
fi fi
fi fi
# Update config # Update config
add_object_key "web" 'DOMAIN' "$domain" 'BACKEND' 'PROXY' add_object_key "web" 'DOMAIN' "$domain_idn" 'BACKEND' 'PROXY'
update_object_value 'web' 'DOMAIN' "$domain" '$BACKEND' "$template" update_object_value 'web' 'DOMAIN' "$domain_idn" '$BACKEND' "$template"
fi fi