Refactoring stage III (db)

This commit is contained in:
Serghey Rodin 2012-03-27 23:08:44 +03:00
commit 33717629f7
21 changed files with 518 additions and 913 deletions

48
bin/v_unsuspend_databases Executable file
View file

@ -0,0 +1,48 @@
#!/bin/bash
# info: unsuspend databases
# options: user
#
# The function for unsuspending all user's databases.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
user=$1
# Importing variables
source $VESTA/conf/vesta.conf
source $VESTA/func/shared.sh
source $VESTA/func/db.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '1' "$#" 'user'
validate_format 'user'
is_system_enabled "$DB_SYSTEM"
is_object_valid 'user' 'USER' "$user"
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Starting unsuspend loop
for database in $(search_objects 'db' 'SUSPENDED' "yes" 'DB'); do
$BIN/v_unsuspend_database "$user" "$database"
done
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Logging
log_event "$OK" "$EVENT"
exit