mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-22 22:34:05 -07:00
Update and rename v-get-database-credentials-of-site to v-get-database-credentials-of-domain
This commit is contained in:
parent
70a59fbedf
commit
4a12408981
1 changed files with 35 additions and 10 deletions
|
@ -1,5 +1,33 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# info: get database credentials of domain and other basic data
|
||||||
|
# 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
|
||||||
|
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
# Variable&Function #
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
|
|
||||||
|
# Argument definition
|
||||||
|
DOMAIN=$1
|
||||||
|
domain=$1
|
||||||
|
SUBFOLDER=''
|
||||||
|
if [ $# -gt 1 ]; then
|
||||||
|
SUBFOLDER=$2
|
||||||
|
fi
|
||||||
|
|
||||||
# Importing system environment
|
# Importing system environment
|
||||||
source /etc/profile
|
source /etc/profile
|
||||||
|
|
||||||
|
@ -7,16 +35,9 @@ source /etc/profile
|
||||||
source /usr/local/vesta/func/main.sh
|
source /usr/local/vesta/func/main.sh
|
||||||
|
|
||||||
|
|
||||||
if [ $# -lt 1 ]; then
|
#----------------------------------------------------------#
|
||||||
echo "USAGE: v-get-database-credentials-of-site DOMAIN [SUBFOLDER]"
|
# Verifications #
|
||||||
exit 1
|
#----------------------------------------------------------#
|
||||||
fi
|
|
||||||
|
|
||||||
DOMAIN=$1
|
|
||||||
SUBFOLDER=''
|
|
||||||
if [ $# -gt 1 ]; then
|
|
||||||
SUBFOLDER=$2
|
|
||||||
fi
|
|
||||||
|
|
||||||
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
|
||||||
|
@ -24,6 +45,10 @@ if [ -z "$USER" ]; then
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
# Action #
|
||||||
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
SITE_FOLDER="/home/$USER/web/$DOMAIN/public_html"
|
SITE_FOLDER="/home/$USER/web/$DOMAIN/public_html"
|
||||||
CHECK_PUBLIC_SHTML=$(/usr/local/vesta/bin/v-list-web-domain "$USER" "$DOMAIN" | grep 'SSL:' | grep -c 'single')
|
CHECK_PUBLIC_SHTML=$(/usr/local/vesta/bin/v-list-web-domain "$USER" "$DOMAIN" | grep 'SSL:' | grep -c 'single')
|
||||||
if [ $CHECK_PUBLIC_SHTML -eq 1 ]; then
|
if [ $CHECK_PUBLIC_SHTML -eq 1 ]; then
|
Loading…
Add table
Add a link
Reference in a new issue