minor changes

This commit is contained in:
allan 2025-06-02 14:28:55 +02:00
parent 8dff46eb5e
commit 43baa965c5
2 changed files with 16 additions and 8 deletions

View File

@ -69,6 +69,10 @@ and also the default "sites-enabled" Nginx configurarion I use
[\[Here\]](https://git.x-files.dk/ubuntu-web-server/nginx-install/src/branch/main/cfg/default) [\[Here\]](https://git.x-files.dk/ubuntu-web-server/nginx-install/src/branch/main/cfg/default)
when you start troubleshooting. when you start troubleshooting.
### Q and A
Q: Why does the script need the MariaDB root password ?\
A: The script need this password in order to be able to create the wordpress database and det the correct permisions.
### More guides ### More guides
More guides can be found on [\[wiki.x-files.dk\]](https://wiki.x-files.dk) More guides can be found on [\[wiki.x-files.dk\]](https://wiki.x-files.dk)

View File

@ -35,6 +35,7 @@ printf -- "giteamultiinstall \n\n"
printf -- "Usage: \n" printf -- "Usage: \n"
printf -- "./giteainstall [-n] <gitea domain> \n" printf -- "./giteainstall [-n] <gitea domain> \n"
printf -- " [-p] <gitea database password> \n" printf -- " [-p] <gitea database password> \n"
printf -- " [-r] <mariadb root password> \n"
printf -- " [-help] <this screen> \n\n" printf -- " [-help] <this screen> \n\n"
printf -- "Examples: \n" printf -- "Examples: \n"
printf -- "./giteamultiinstall -n git.something.xyz -p giteadatabsepwd\n\n"; } printf -- "./giteamultiinstall -n git.something.xyz -p giteadatabsepwd\n\n"; }
@ -48,7 +49,8 @@ servicedead () { status=$(systemctl is-active $service); if [[ "$status" != "ac
# #
inputcheck () { inputcheck () {
if [[ -z "$hostname" ]]; then usage ; printf "Error! Hostname Empty...\n\n" ; exit; fi 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 "$giteapwd" ]]; 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 # If Nginx and MariaDB is not running then die
# #
@ -61,13 +63,12 @@ clear ; title
# #
# Configure command line options # Configure command line options
# #
# Removed due to SC2199 and not really needed start
# if [[ ! $@ =~ ^\-.+ ]]; then usage; fi # shellcheck disable=SC2199
# Removed due to SC2199 and not really needed stop if [[ ! $@ =~ ^\-.+ ]]; then usage; fi
# shellcheck disable=SC2086 # shellcheck disable=SC2086
while getopts "n:p:r:h:" option; do
while getopts "n:p:h:" option; do
case $option in case $option in
n) # hostname n) # hostname
@ -76,6 +77,9 @@ while getopts "n:p:h:" option; do
p) # database password p) # database password
giteapwd=$OPTARG;; giteapwd=$OPTARG;;
r) # database password
mariadbpwd=$OPTARG;;
h) # display help h) # display help
usage ; exit;; usage ; exit;;
@ -86,7 +90,7 @@ done
# #
# Check if input conditions are met # Check if input conditions are met
# #
inputcheck "$hostname" "$giteapwd" inputcheck "$hostname" "$giteapwd" "$mariadbpwd"
# #
# Check if a Nginx conf file with the hostname allready exists # Check if a Nginx conf file with the hostname allready exists
# #
@ -122,7 +126,7 @@ GRANT ALL PRIVILEGES ON $giteauser$giteadb.* TO '$giteauser'@'127.0.0.1' IDENTIF
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
" "
printf '%s\n' "${giteasql[@]}" |sed '1d; $d' > giteasql.sql printf '%s\n' "${giteasql[@]}" |sed '1d; $d' > giteasql.sql
mysql < giteasql.sql mysql -u root -p"$mariadbpwd" < giteasql.sql
# #
# Create a Gitea Nginx configuration file # Create a Gitea Nginx configuration file
# #