minor changes

This commit is contained in:
2025-05-27 09:21:03 +02:00
parent 3d9f12ee3a
commit b70cd2dba8
2 changed files with 18 additions and 15 deletions

View File

@@ -13,22 +13,22 @@ if [[ $(id -u) -ne 0 ]]; then echo "" && echo "Must be root or use sudo" && echo
# Are we in the right directory
#
scriptdir="gitea-install" && whereami=$(pwd |awk -F'/' '{print $NF}')
if [ $whereami != $scriptdir ]; then printf "\nWrong directory! Script must be run from $scriptdir\n\n"; exit 1; fi
if [ "$whereami" != "$scriptdir" ]; then printf "\nWrong directory! Script must be run from %s\n\n" "$scriptdir"; exit 1; fi
#
# Define variables and functions
#
line () { printf -- '-%.0s' {1..50}; printf '\n'; }
nginxconfig=$(ls -la |grep "conf" |awk '{print $9}')
line (){ for i in {1..50}; do echo -n "$1"; done && printf "\n"; }
#
# Function to check if a service is already running or not
#
serviceno () { printf "\n$service is not running cannot continue...\n\n"; }
serviceno () { printf "\n%s" $service ; printf " is not running cannot continue...\n\n"; }
servicedead () { status=$(systemctl is-active $service); if [[ "$status" != "active" ]]; then serviceno ; exit; fi; }
#
# Function title
#
title () { printf "\nGitea postinstall script V1.0${normal}\n\n"; }
title () { printf "\nGitea postinstall script V1.0\n\n"; }
#
# If Gitea is not running then die
#