minor changes

This commit is contained in:
allan 2025-06-02 13:57:00 +02:00
parent 6859213f17
commit defcc52072

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 "$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 "$mariadbpass" ]]; then usage ; printf "Error! Database Password Empty...\n\n" ; exit; fi; }
if [[ -z "$mariadbpwd" ]]; then usage ; printf "Error! Database Password Empty...\n\n" ; exit; fi; }
#
# 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;;
r) # mariadb root password
mariadbpass=$OPTARG;;
mariadbpwd=$OPTARG;;
h) # display help
usage ; exit;;
@ -95,7 +95,7 @@ done
#
# Check if input conditions are met
#
inputcheck "$hostname" "$wpdbname" "$wpdbuser" "$wpdbpass" "$mariadbpass"
inputcheck "$hostname" "$wpdbname" "$wpdbuser" "$wpdbpass" "$mariadbpwd"
#
# Download Wordpress
#
@ -129,7 +129,7 @@ GRANT ALL PRIVILEGES ON $wpdbname.* TO '$wpdbuser'@'localhost';
FLUSH PRIVILEGES;
"
printf '%s\n' "${wpsql[@]}" |sed '1d; $d' > wpsql.sql
mysql -u root -p"$mariadbpass" < wpsql.sql
mysql -u root -p"$mariadbpwd" < wpsql.sql
#
# Create a Wordpress Nginx configuration file
#