Skip to content

Commit cc6491e

Browse files
committed
mass stats update
1 parent c25fd96 commit cc6491e

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

bin/v_upd_web_domains_stat

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/bin/bash
2+
# info: updating web statistics for all domains
3+
4+
#----------------------------------------------------------#
5+
# Variable&Function #
6+
#----------------------------------------------------------#
7+
8+
# Argument defenition
9+
user="$1"
10+
11+
# Importing variables
12+
source $VESTA/conf/vars.conf
13+
source $V_FUNC/shared_func.sh
14+
source $V_FUNC/domain_func.sh
15+
16+
17+
#----------------------------------------------------------#
18+
# Verifications #
19+
#----------------------------------------------------------#
20+
21+
# Checking arg number
22+
check_args '1' "$#" 'user'
23+
24+
# Checking argument format
25+
format_validation 'user'
26+
27+
# Checking web system is enabled
28+
is_system_enabled 'web'
29+
30+
# Checking user
31+
is_user_valid
32+
33+
34+
#----------------------------------------------------------#
35+
# Action #
36+
#----------------------------------------------------------#
37+
38+
# Defining config
39+
conf="$V_USERS/$user/web.conf"
40+
41+
# Defining fileds to select
42+
field='$DOMAIN'
43+
44+
# Defining search string
45+
search_string="SUSPEND='no'"
46+
47+
# Parsing domain list
48+
domains=$(dom_clear_search)
49+
50+
# Starting upd loop
51+
for domain in $domains; do
52+
stats=$(get_web_domain_value '$STATS')
53+
if [ ! -z "$stats" ]; then
54+
$V_BIN/v_upd_web_domain_stat "$user" "$domain"
55+
rv="$?"
56+
if [ "$rv" -ne '0' ]; then
57+
log_event 'debug' "$rv $V_EVENT"
58+
exit $rv
59+
fi
60+
fi
61+
done
62+
63+
#----------------------------------------------------------#
64+
# Vesta #
65+
#----------------------------------------------------------#
66+
67+
# Logging
68+
log_event 'system' "$V_EVENT"
69+
70+
exit $OK

0 commit comments

Comments
 (0)