minor changes

This commit is contained in:
allan 2025-06-02 13:43:12 +02:00
parent 5820d3dfb9
commit b64b73fdbf

View File

@ -50,7 +50,7 @@ if [[ -z "$hostname" ]]; then usage ; printf "Error! Hostname Empty...\n\n" ; ex
if [[ -z "$wpdbname" ]]; then usage ; printf "Error! Database name Empty...\n\n" ; exit; fi if [[ -z "$wpdbname" ]]; then usage ; printf "Error! Database name Empty...\n\n" ; exit; fi
if [[ -z "$wpdbuser" ]]; then usage ; printf "Error! Database username Empty...\n\n" ; exit; fi if [[ -z "$wpdbuser" ]]; then usage ; printf "Error! Database username Empty...\n\n" ; exit; fi
if [[ -z "$wpdbpass" ]]; then usage ; printf "Error! Database Password Empty...\n\n" ; exit; fi if [[ -z "$wpdbpass" ]]; then usage ; printf "Error! Database Password Empty...\n\n" ; exit; fi
if [[ -z "$rootdbpass" ]]; then usage ; printf "Error! Database Password Empty...\n\n" ; exit; fi; } if [[ -z "$mariadbpass" ]]; then usage ; printf "Error! Database Password Empty...\n\n" ; exit; fi; }
# #
# If Nginx and MariaDB is not running then die # If Nginx and MariaDB is not running then die
# #
@ -83,7 +83,7 @@ while getopts "n:d:u:p:r:h:" option; do
wpdbpass=$OPTARG;; wpdbpass=$OPTARG;;
r) # wordpress database password r) # wordpress database password
rootdbpass=$OPTARG;; mariadbpass=$OPTARG;;
h) # display help h) # display help
usage ; exit;; usage ; exit;;
@ -95,7 +95,7 @@ done
# #
# Check if input conditions are met # Check if input conditions are met
# #
inputcheck "$hostname" "$wpdbname" "$wpdbuser" "$wpdbpass" "$rootdbpass" inputcheck "$hostname" "$wpdbname" "$wpdbuser" "$wpdbpass" "$mariadbpass"
# #
# Download Wordpress # Download Wordpress
# #
@ -129,7 +129,7 @@ GRANT ALL PRIVILEGES ON $wpdbname.* TO '$wpdbuser'@'localhost';
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
" "
printf '%s\n' "${wpsql[@]}" |sed '1d; $d' > wpsql.sql printf '%s\n' "${wpsql[@]}" |sed '1d; $d' > wpsql.sql
mysql -u root -p"$rootdbpass" < wpsql.sql mysql -u root -p"$mariadbpass" < wpsql.sql
# #
# Create a Wordpress Nginx configuration file # Create a Wordpress Nginx configuration file
# #