Update v-get-database-credentials-of-domain

This commit is contained in:
myvesta 2020-07-12 22:24:35 +02:00 committed by GitHub
commit d3229d4fbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,28 +1,16 @@
#!/bin/bash #!/bin/bash
# info: get database credentials of domain and other basic data # info: get database credentials and other basic data of domain
# options: DOMAIN [SUBFOLDER] # options: DOMAIN [SUBFOLDER]
# #
# The function get database credentials of domain and other basic data. # The function get database credentials and other basic data of domain.
#----------------------------------------------------------#
# Check necessary parameters #
#----------------------------------------------------------#
if [ $# -lt 1 ]; then
echo "USAGE: v-get-database-credentials-of-site DOMAIN [SUBFOLDER]"
exit 1
fi
#----------------------------------------------------------# #----------------------------------------------------------#
# Variable&Function # # Variable&Function #
#----------------------------------------------------------# #----------------------------------------------------------#
# Argument definition # Argument definition
DOMAIN=$1 DOMAIN=$1
domain=$1
SUBFOLDER='' SUBFOLDER=''
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then
SUBFOLDER=$2 SUBFOLDER=$2
@ -34,11 +22,14 @@ source /etc/profile
# Includes # Includes
source /usr/local/vesta/func/main.sh source /usr/local/vesta/func/main.sh
#----------------------------------------------------------# #----------------------------------------------------------#
# Verifications # # Verifications #
#----------------------------------------------------------# #----------------------------------------------------------#
check_args '1' "$#" 'DOMAIN [SUBFOLDER]'
domain=$DOMAIN
is_format_valid 'domain'
USER=$(/usr/local/vesta/bin/v-search-domain-owner "$DOMAIN") USER=$(/usr/local/vesta/bin/v-search-domain-owner "$DOMAIN")
if [ -z "$USER" ]; then if [ -z "$USER" ]; then
echo "Error: domain $DOMAIN does not exists" echo "Error: domain $DOMAIN does not exists"