minor changes

This commit is contained in:
allan 2025-05-26 15:44:24 +02:00
parent 55aa37782e
commit 1583862ddb

@ -12,15 +12,13 @@ if [[ $(id -u) -ne 0 ]]; then echo "" && echo "Must be root or use sudo" && echo
# Are we in the right directory
#
scriptdir="dokuwiki-install" && whereami=$(pwd |awk -F'/' '{print $NF}')
if [ $whereami != $scriptdir ]; then printf "\nWrong directory! Script must be run from $scriptdir\n\n" ; exit ; fi
if [ "$whereami" != "$scriptdir" ]; then printf "\nWrong directory! Script must be run from %s\n\n" "$scriptdir"; exit 1; fi
#
# Define variables and functions
#
red='\033[0;31m' ; bred='\033[1;31m' ; green='\033[0;92m' ; blue='\033[0;36m' ; bold='\033[1m' ; normal='\033[0m'
line (){ for i in {1..50}; do echo -n "$1"; done && printf "\n"; }
line () { printf -- '-%.0s' {1..50}; printf '\n'; }
nginxfiles="/etc/nginx/nginxsnippets"
phpver=$(php -v |head -1 |awk -F'.' '{print $1"."$2}' |sed 's/PHP //')
phpfpm="php$phpver-fpm" ; phpclidir="/etc/php/$phpver/cli" ; phpfpmdir="/etc/php/$phpver/fpm" ; socket="php$phpver"
phpver=$(php -v |head -1 |awk -F'.' '{print $1"."$2}' |sed 's/PHP //') ; phpfpm="php$phpver-fpm"
#
# Function title
#
@ -28,22 +26,22 @@ title () { printf "\nDokuwiki install script V1.0\n\n"; }
#
# Function usage
#
usage () { clear ; printf -- "\n"
printf -- "${bold}dokuwikiinstall${normal} \n\n"
printf -- "${bold}Usage:${normal} \n"
usage () { clear ; printf -- "\n"
printf -- "dokuwikiinstall \n\n"
printf -- "Usage: \n"
printf -- "./dokuwikiinstall <domain> \n"
printf -- "${bold}Examples:${normal} \n"
printf -- "Examples: \n"
printf -- "./dokuwikiinstall wiki.something.xyz\n\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 input check
#
inputcheck () {
if [[ -z "$1" ]]; then printf "${bold}Error! ${normal}Hostname Empty...\n\n" ; exit; fi; }
if [[ -z "$1" ]]; then printf "Error! Hostname Empty...\n\n" ; exit; fi; }
#
# If Nginx is not running then die
#