mirror of
https://github.com/myvesta/vesta
synced 2025-07-30 19:40:56 -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
65
bin/v-change-database-password
Executable file
65
bin/v-change-database-password
Executable file
|
@ -0,0 +1,65 @@
|
|||
#!/bin/bash
|
||||
# info: change database password
|
||||
# options: user database dbpass
|
||||
#
|
||||
# The function for changing database user password to a database. It uses the
|
||||
# full name of database as argument.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
user=$1
|
||||
database=$2
|
||||
dbpass=$3
|
||||
|
||||
# Includes
|
||||
source $VESTA/conf/vesta.conf
|
||||
source $VESTA/func/main.sh
|
||||
source $VESTA/func/db.sh
|
||||
|
||||
# Hiding password
|
||||
A3='******'
|
||||
EVENT="DATE='$DATE' TIME='$TIME' CMD='$SCRIPT' A1='$A1' A2='$A2' A3='$A3'"
|
||||
EVENT="$EVENT A4='$A4' A5='$A5' A6='$A6' A7='$A7' A8='$A8' A9='$A9'"
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '3' "$#" 'user database dbpass'
|
||||
validate_format 'user' 'database' 'dbpass'
|
||||
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
|
||||
|
||||
case $TYPE in
|
||||
mysql) change_mysql_password ;;
|
||||
pgsql) change_pgsql_password ;;
|
||||
esac
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Update config value
|
||||
update_object_value 'db' 'DB' "$database" '$MD5' "$md5"
|
||||
|
||||
# Logging
|
||||
log_history "changed $database database password"
|
||||
log_event "$OK" "$EVENT"
|
||||
|
||||
exit
|
Loading…
Add table
Add a link
Reference in a new issue