| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #!/bin/bash
- # info: rebuild databases
- # options: user
- #
- # The function for rebuilding of all databases of a single user.
- #----------------------------------------------------------#
- # Variable&Function #
- #----------------------------------------------------------#
- # Argument defenition
- user=$1
- # Includes
- source $VESTA/conf/vesta.conf
- source $VESTA/func/main.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 rebuild loop
- for database in $(search_objects 'db' 'SUSPENDED' "no" 'DB'); do
- get_database_values
- # Switching on db type
- case $TYPE in
- mysql) rebuild_mysql_database ;;
- pgsql) rebuild_pgsql_database ;;
- esac
- done
- #----------------------------------------------------------#
- # Vesta #
- #----------------------------------------------------------#
- # Logging
- log_event "$OK" "$EVENT"
- exit
|