mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 02:28:03 -07:00
mass stats update
This commit is contained in:
parent
c25fd964e1
commit
cc6491ef34
1 changed files with 70 additions and 0 deletions
70
bin/v_upd_web_domains_stat
Executable file
70
bin/v_upd_web_domains_stat
Executable file
|
@ -0,0 +1,70 @@
|
|||
#!/bin/bash
|
||||
# info: updating web statistics for all domains
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
user="$1"
|
||||
|
||||
# Importing variables
|
||||
source $VESTA/conf/vars.conf
|
||||
source $V_FUNC/shared_func.sh
|
||||
source $V_FUNC/domain_func.sh
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Checking arg number
|
||||
check_args '1' "$#" 'user'
|
||||
|
||||
# Checking argument format
|
||||
format_validation 'user'
|
||||
|
||||
# Checking web system is enabled
|
||||
is_system_enabled 'web'
|
||||
|
||||
# Checking user
|
||||
is_user_valid
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Defining config
|
||||
conf="$V_USERS/$user/web.conf"
|
||||
|
||||
# Defining fileds to select
|
||||
field='$DOMAIN'
|
||||
|
||||
# Defining search string
|
||||
search_string="SUSPEND='no'"
|
||||
|
||||
# Parsing domain list
|
||||
domains=$(dom_clear_search)
|
||||
|
||||
# Starting upd loop
|
||||
for domain in $domains; do
|
||||
stats=$(get_web_domain_value '$STATS')
|
||||
if [ ! -z "$stats" ]; then
|
||||
$V_BIN/v_upd_web_domain_stat "$user" "$domain"
|
||||
rv="$?"
|
||||
if [ "$rv" -ne '0' ]; then
|
||||
log_event 'debug' "$rv $V_EVENT"
|
||||
exit $rv
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Logging
|
||||
log_event 'system' "$V_EVENT"
|
||||
|
||||
exit $OK
|
Loading…
Add table
Add a link
Reference in a new issue