mirror of
https://github.com/myvesta/vesta
synced 2025-08-21 05:44:08 -07:00
dox2unix fix after merge
This commit is contained in:
parent
6e0aba66e0
commit
b8b28120fd
231 changed files with 20776 additions and 20776 deletions
|
@ -1,65 +1,65 @@
|
|||
#!/bin/bash
|
||||
# info: delete database
|
||||
# options: USER DATABASE
|
||||
#
|
||||
# The function for deleting the database. If database user have access to
|
||||
# another database, he will not be deleted.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
user=$1
|
||||
database=$2
|
||||
|
||||
# Includes
|
||||
source $VESTA/conf/vesta.conf
|
||||
source $VESTA/func/main.sh
|
||||
source $VESTA/func/db.sh
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '2' "$#" 'USER DATABASE'
|
||||
validate_format 'user' 'database'
|
||||
is_system_enabled "$DB_SYSTEM"
|
||||
is_object_valid 'user' 'USER' "$user"
|
||||
is_object_unsuspended 'user' 'USER' "$user"
|
||||
is_object_valid 'db' 'DB' "$database"
|
||||
is_object_unsuspended 'db' 'DB' "$database"
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Get database values
|
||||
get_database_values
|
||||
|
||||
# Switching on db type
|
||||
case $TYPE in
|
||||
mysql) delete_mysql_database ;;
|
||||
pgsql) delete_pgsql_database ;;
|
||||
esac
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Deleting database
|
||||
sed -i "/DB='$database' /d" $USER_DATA/db.conf
|
||||
|
||||
# Decreasing counters
|
||||
decrease_dbhost_values
|
||||
decrease_user_value "$user" '$U_DATABASES'
|
||||
|
||||
# Logging
|
||||
log_history "deleted $database database"
|
||||
log_event "$OK" "$EVENT"
|
||||
|
||||
exit
|
||||
#!/bin/bash
|
||||
# info: delete database
|
||||
# options: USER DATABASE
|
||||
#
|
||||
# The function for deleting the database. If database user have access to
|
||||
# another database, he will not be deleted.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
user=$1
|
||||
database=$2
|
||||
|
||||
# Includes
|
||||
source $VESTA/conf/vesta.conf
|
||||
source $VESTA/func/main.sh
|
||||
source $VESTA/func/db.sh
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '2' "$#" 'USER DATABASE'
|
||||
validate_format 'user' 'database'
|
||||
is_system_enabled "$DB_SYSTEM"
|
||||
is_object_valid 'user' 'USER' "$user"
|
||||
is_object_unsuspended 'user' 'USER' "$user"
|
||||
is_object_valid 'db' 'DB' "$database"
|
||||
is_object_unsuspended 'db' 'DB' "$database"
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Get database values
|
||||
get_database_values
|
||||
|
||||
# Switching on db type
|
||||
case $TYPE in
|
||||
mysql) delete_mysql_database ;;
|
||||
pgsql) delete_pgsql_database ;;
|
||||
esac
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Deleting database
|
||||
sed -i "/DB='$database' /d" $USER_DATA/db.conf
|
||||
|
||||
# Decreasing counters
|
||||
decrease_dbhost_values
|
||||
decrease_user_value "$user" '$U_DATABASES'
|
||||
|
||||
# Logging
|
||||
log_history "deleted $database database"
|
||||
log_event "$OK" "$EVENT"
|
||||
|
||||
exit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue