mirror of
https://github.com/myvesta/vesta
synced 2025-08-21 05:44:08 -07:00
Update v-get-database-credentials-of-domain
This commit is contained in:
parent
4a12408981
commit
d3229d4fbd
1 changed files with 6 additions and 15 deletions
|
@ -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"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue