Files
VestaCP/bin/v_delete_web_domains
2012-04-30 12:32:11 +03:00

48 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# info: delete web domains
# options: user
#
# The function deteles all user's webdomains.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
user=$1
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '1' "$#" 'user'
validate_format 'user'
is_system_enabled "$WEB_SYSTEM"
is_object_valid 'user' 'USER' "$user"
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Starting delete loop
for domain in $(search_objects 'web' 'SUSPENDED' "no" 'DOMAIN'); do
$BIN/v_delete_web_domain "$user" "$domain" 'no'
done
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Logging
log_event "$OK" "$EVENT"
exit