mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 10:37:39 -07:00
web function refactoring
This commit is contained in:
parent
73b63016d4
commit
872cd3ac45
20 changed files with 744 additions and 1239 deletions
|
@ -27,7 +27,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"
|
||||
|
@ -46,7 +46,7 @@ get_domain_values 'web'
|
|||
|
||||
# Comparing stats types
|
||||
if [ "$STATS" == $type ]; then
|
||||
log_event "$OK" "$EVENT"
|
||||
log_event "$OK" "$ARGUMENTS"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
@ -59,10 +59,8 @@ rm -rf $stats_dir/*
|
|||
# Deleting config
|
||||
rm -f $HOMEDIR/$user/conf/web/$STATS.$domain.conf
|
||||
|
||||
# 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" \
|
||||
|
@ -98,7 +96,7 @@ update_object_value 'web' 'DOMAIN' "$domain" '$STATS' "$type"
|
|||
|
||||
# Logging
|
||||
log_history "changed web log stats for $domain to $type"
|
||||
log_event "$OK" "$EVENT"
|
||||
log_event "$OK" "$ARGUMENTS"
|
||||
|
||||
# Build stats
|
||||
exec $BIN/v-update-web-domain-stat $user $domain
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue