minor changes

This commit is contained in:
allan 2025-06-02 13:55:01 +02:00
parent ba97731670
commit c9f3d76076

View File

@ -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
#