mirror of
https://github.com/myvesta/vesta
synced 2025-07-16 10:03:23 -07:00
replaced underscore with dash in api syscalls
This commit is contained in:
parent
7ed705cee7
commit
b6b7eacadb
283 changed files with 438 additions and 412 deletions
68
bin/v-delete-web-domain-stats
Executable file
68
bin/v-delete-web-domain-stats
Executable file
|
@ -0,0 +1,68 @@
|
|||
#!/bin/bash
|
||||
# info: delete web domain statistics
|
||||
# options: user domain
|
||||
#
|
||||
# The function of deleting site's system of statistics. Its type is
|
||||
# automatically chooses from client's configuration file.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
user=$1
|
||||
domain=$(idn -t --quiet -u "$2" )
|
||||
|
||||
# Includes
|
||||
source $VESTA/conf/vesta.conf
|
||||
source $VESTA/func/main.sh
|
||||
source $VESTA/func/domain.sh
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '2' "$#" 'user domain'
|
||||
validate_format 'user' 'domain'
|
||||
is_system_enabled "$WEB_SYSTEM"
|
||||
is_object_valid 'user' 'USER' "$user"
|
||||
is_object_unsuspended 'user' 'USER' "$user"
|
||||
is_object_valid 'web' 'DOMAIN' "$domain"
|
||||
is_object_unsuspended 'web' 'DOMAIN' "$domain"
|
||||
is_object_value_exist 'web' 'DOMAIN' "$domain" '$STATS'
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Defining statistic type
|
||||
get_domain_values 'web'
|
||||
|
||||
# Defining statistic dir
|
||||
stats_dir="$HOMEDIR/$user/web/$domain/stats"
|
||||
|
||||
# Deleting dir content
|
||||
rm -rf $stats_dir/*
|
||||
|
||||
# Deleting config
|
||||
rm -f $HOMEDIR/$user/conf/web/$STATS.$domain.conf
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Deleting pipe command
|
||||
sed -i "/ $domain$/d" $VESTA/data/queue/webstats.pipe
|
||||
|
||||
# Update config
|
||||
update_object_value 'web' 'DOMAIN' "$domain" '$STATS' ''
|
||||
|
||||
# Logging
|
||||
log_history "disabled web log analyzer for $domain"
|
||||
log_event "$OK" "$EVENT"
|
||||
|
||||
exit
|
Loading…
Add table
Add a link
Reference in a new issue