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