minor changes
This commit is contained in:
parent
8dff46eb5e
commit
43baa965c5
@ -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)
|
||||
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 can be found on [\[wiki.x-files.dk\]](https://wiki.x-files.dk)
|
||||
|
||||
|
20
giteainstall
20
giteainstall
@ -35,6 +35,7 @@ printf -- "giteamultiinstall \n\n"
|
||||
printf -- "Usage: \n"
|
||||
printf -- "./giteainstall [-n] <gitea domain> \n"
|
||||
printf -- " [-p] <gitea database password> \n"
|
||||
printf -- " [-r] <mariadb root password> \n"
|
||||
printf -- " [-help] <this screen> \n\n"
|
||||
printf -- "Examples: \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 () {
|
||||
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
|
||||
#
|
||||
@ -61,13 +63,12 @@ clear ; title
|
||||
#
|
||||
# Configure command line options
|
||||
#
|
||||
# Removed due to SC2199 and not really needed start
|
||||
# if [[ ! $@ =~ ^\-.+ ]]; then usage; fi
|
||||
# Removed due to SC2199 and not really needed stop
|
||||
|
||||
# shellcheck disable=SC2199
|
||||
if [[ ! $@ =~ ^\-.+ ]]; then usage; fi
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
|
||||
while getopts "n:p:h:" option; do
|
||||
while getopts "n:p:r:h:" option; do
|
||||
case $option in
|
||||
|
||||
n) # hostname
|
||||
@ -76,6 +77,9 @@ while getopts "n:p:h:" option; do
|
||||
p) # database password
|
||||
giteapwd=$OPTARG;;
|
||||
|
||||
r) # database password
|
||||
mariadbpwd=$OPTARG;;
|
||||
|
||||
h) # display help
|
||||
usage ; exit;;
|
||||
|
||||
@ -86,7 +90,7 @@ done
|
||||
#
|
||||
# Check if input conditions are met
|
||||
#
|
||||
inputcheck "$hostname" "$giteapwd"
|
||||
inputcheck "$hostname" "$giteapwd" "$mariadbpwd"
|
||||
#
|
||||
# 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;
|
||||
"
|
||||
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
|
||||
#
|
||||
|
Loading…
x
Reference in New Issue
Block a user