diff --git a/giteainstall b/giteainstall index 1696a5b..c9515ed 100755 --- a/giteainstall +++ b/giteainstall @@ -46,7 +46,7 @@ servicedead () { status=$(systemctl is-active $service); if [[ "$status" != "ac inputcheck () { if [[ -z "$hostname" ]]; then usage ; printf "Error! Hostname Empty...\n\n" ; exit; fi if [[ -z "$giteapwd" ]]; 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 # @@ -74,7 +74,7 @@ while getopts "n:p:r:h:" option; do giteapwd=$OPTARG;; r) # mariadb root password - mariadbpass=$OPTARG;; + mariadbpwd=$OPTARG;; h) # display help usage ; exit;; @@ -86,7 +86,7 @@ done # # Check if input conditions are met # -inputcheck "$hostname" "$giteapwd" +inputcheck "$hostname" "$giteapwd" "$mariadbpwd" # # Download and install Gitea # @@ -108,7 +108,7 @@ GRANT ALL PRIVILEGES ON gitea.* TO 'gitea'@'127.0.0.1' IDENTIFIED BY '$giteapwd' FLUSH PRIVILEGES; " printf '%s\n' "${giteasql[@]}" |sed '1d; $d' > giteasql.sql -mysql -u root -p"$mariadbpass" < giteasql.sql +mysql -u root -p"$mariadbpwd" < giteasql.sql # # Create a Gitea Nginx configuration file #