From d3229d4fbda2d6a57ad2fbbe4ba79fd3909ad649 Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Sun, 12 Jul 2020 22:24:35 +0200 Subject: [PATCH] Update v-get-database-credentials-of-domain --- bin/v-get-database-credentials-of-domain | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/bin/v-get-database-credentials-of-domain b/bin/v-get-database-credentials-of-domain index 0082dc9c..7ebade2a 100644 --- a/bin/v-get-database-credentials-of-domain +++ b/bin/v-get-database-credentials-of-domain @@ -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"