web function refactoring

This commit is contained in:
Serghey Rodin 2016-06-09 17:05:41 +03:00
commit 872cd3ac45
20 changed files with 744 additions and 1239 deletions

View file

@ -30,7 +30,7 @@ source $VESTA/conf/vesta.conf
#----------------------------------------------------------#
check_args '3' "$#" 'USER DOMAIN TYPE'
validate_format 'user' 'domain'
is_format_valid 'user' 'domain'
is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
is_type_valid "$STATS_SYSTEM" "$type"
is_object_valid 'user' 'USER' "$user" "$user"
@ -47,10 +47,8 @@ is_object_value_empty 'web' 'DOMAIN' "$domain" '$STATS'
# Parse aliases
get_domain_values 'web'
# Preparing domain values for the template substitution
upd_web_domain_values
# Adding statistic config
prepare_web_domain_values
cat $WEBTPL/$type/$type.tpl |\
sed -e "s|%ip%|$ip|g" \
-e "s|%web_port%|$WEB_PORT|g" \
@ -90,7 +88,7 @@ update_object_value 'web' 'DOMAIN' "$domain" '$STATS' "$type"
# Logging
log_history "enabled web log analyzer for $domain"
log_event "$OK" "$EVENT"
log_event "$OK" "$ARGUMENTS"
# Build stats
exec $BIN/v-update-web-domain-stat $user $domain