help msg update

This commit is contained in:
Cold-Egg
2020-03-04 16:30:52 -05:00
parent f87fff6f96
commit 97e3cbd3fb
7 changed files with 200 additions and 54 deletions
+21 -9
View File
@@ -7,13 +7,25 @@ SQL_USER=''
SQL_PASS=''
ANY="'%'"
SET_OK=0
EPACE=' '
echow(){
FLAG=${1}
shift
echo -e "\033[1m${EPACE}${FLAG}\033[0m${@}"
}
help_message(){
echo 'Command [-domain xxx]'
echo 'Command [-domain xxx] [-user xxx] [-password xxx] [-database xxx]'
echo 'Example 1: database.sh -domain example.com'
echo 'Example 2: database.sh -domain example.com -user USERNAME -password PASSWORD -database DATABASENAME'
echo 'Script will auto assign database & username by the domain and random password for example 1'
echo -e "\033[1mOPTIONS\033[0m"
echow '-D, --domain [DOMAIN_NAME]'
echo "${EPACE}${EPACE}Example: database.sh -D example.com"
echo "${EPACE}${EPACE}Will auto generate Database/username/password for the domain"
echow '-D, --domain [DOMAIN_NAME] -U, --user [xxx] -P, --password [xxx] -DB, --database [xxx]'
echo "${EPACE}${EPACE}Example: database.sh -D example.com -U USERNAME -P PASSWORD -DB DATABASENAME"
echo "${EPACE}${EPACE}Will create Database/username/password by given"
echow '-H, --help'
echo "${EPACE}${EPACE}Display help and exit."
exit 0
}
check_input(){
@@ -120,16 +132,16 @@ while [ ! -z "${1}" ]; do
-[hH] | -help | --help)
help_message
;;
-d | -D | -domain) shift
-[dD] | -domain| --domain) shift
DOMAIN="${1}"
;;
-u | -U | -user) shift
-[uU] | -user | --user) shift
SQL_USER="${1}"
;;
-p | -P | -password) shift
-[pP] | -password| --password) shift
SQL_PASS="'${1}'"
;;
-db | -DB | -database) shift
-db | -DB | -database| --database) shift
SQL_DB="${1}"
;;
*)