check_result function

This commit is contained in:
Serghey Rodin 2015-10-28 16:34:41 +02:00
commit 91a804c1c8
66 changed files with 204 additions and 404 deletions

View file

@ -52,7 +52,7 @@ upd_web_domain_values
del_web_config
add_web_config
# Check SSL
# Checking SSL
if [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
@ -61,19 +61,19 @@ if [ "$SSL" = 'yes' ]; then
fi
# Checking proxy
if [ ! -z "$PROXY" ]; then
if [ ! -z "$PROXY_SYSTEM" ] && [ ! -z "$PROXY" ]; then
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.tpl"
conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf"
del_web_config
add_web_config
fi
# Checking SSL proxy
if [ ! -z "$PROXY" ] && [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
del_web_config
add_web_config
# Checking proxy SSL
if [ "$SSL" = 'yes' ]; then
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
del_web_config
add_web_config
fi
fi
@ -81,20 +81,18 @@ fi
# Vesta #
#----------------------------------------------------------#
# Update config
# Updating config
update_object_value 'web' 'DOMAIN' "$domain" '$SUSPENDED' 'no'
decrease_user_value "$user" '$SUSPENDED_WEB'
# Restart web erver
# Restarting web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit $E_RESTART
fi
check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-proxy
if [ $? -ne 0 ]; then
exit $E_RESTART
if [ ! -z "$PROXY_SYSTEM" ]; then
$BIN/v-restart-proxy
check_result $? "Proxy restart failed" >/dev/null
fi
fi