mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 10:37:39 -07:00
Code refactoring: domain_idn + new restart routine
This commit is contained in:
parent
b98abaf572
commit
e5950d516d
104 changed files with 605 additions and 588 deletions
|
@ -21,6 +21,10 @@ source $VESTA/func/domain.sh
|
|||
source $VESTA/func/ip.sh
|
||||
source $VESTA/conf/vesta.conf
|
||||
|
||||
# Additional argument formatting
|
||||
format_domain
|
||||
format_domain_idn
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
|
@ -44,12 +48,6 @@ is_ip_valid "$ip" "$user"
|
|||
get_domain_values 'web'
|
||||
old=$(get_real_ip $IP)
|
||||
new=$ip
|
||||
if [[ "$domain" = *[![:ascii:]]* ]]; then
|
||||
domain_idn=$(idn -t --quiet -a $domain)
|
||||
else
|
||||
domain_idn=$domain
|
||||
fi
|
||||
|
||||
|
||||
# Replacing vhost
|
||||
replace_web_config "$WEB_SYSTEM" "$TPL.tpl"
|
||||
|
@ -78,15 +76,11 @@ decrease_ip_value "$old"
|
|||
update_object_value 'web' 'DOMAIN' "$domain" '$IP' "$3"
|
||||
|
||||
# Restart web server
|
||||
if [ "$restart" != 'no' ]; then
|
||||
$BIN/v-restart-web
|
||||
check_result $? "WEB restart failed" >/dev/null
|
||||
$BIN/v-restart-web $restart
|
||||
check_result $? "WEB restart failed" >/dev/null
|
||||
|
||||
if [ ! -z "$PROXY_SYSTEM" ]; then
|
||||
$BIN/v-restart-proxy
|
||||
check_result $? "Proxy restart failed" >/dev/null
|
||||
fi
|
||||
fi
|
||||
$BIN/v-restart-proxy $restart
|
||||
check_result $? "Proxy restart failed" >/dev/null
|
||||
|
||||
# Logging
|
||||
log_history "changed web domain $domain ip to $3"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue