comment corrections only no code changes

This commit is contained in:
2025-12-06 11:07:37 +01:00
parent ea2537e18a
commit 7a295c0695

View File

@@ -1,5 +1,4 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: MIT
# Author : Allan Christensen
# First Created : 05012022 (DD-MM-YYYY)
@@ -12,13 +11,13 @@
if [[ $(id -u) -ne 0 ]]; then echo "" && echo "Must be root or use sudo" && echo "" ; exit 1 ; fi
#
# Get php-fpm version
# Get PHP-FPM version
#
phpfpm=$(systemctl list-unit-files --type=service | awk '/php[0-9]+\.[0-9]+-fpm\.service/ {sub(".service","",$1); print $1; exit}')
if [[ -z "$phpfpm" ]]; then printf "\nUnable to detect php-fpm version. Is PHP-FPM installed?\n\n" ; exit 1 ; fi
#
# Check if required services are running or not
# Check if required services are running
#
for svc in nginx "$phpfpm"; do systemctl is-active --quiet "$svc" || { printf "\n%s is not running, cannot continue...\n\n" "${svc^}" ; exit 1 ; }; done
@@ -44,7 +43,7 @@ usage () {
#
if [[ $# -ne 1 ]]; then
usage
printf "ERROR: Exactly one argument (the domain ony).\n\n"
printf "ERROR: Exactly one argument (the domain only).\n\n"
exit 1
fi
@@ -117,14 +116,14 @@ sed -i -- "s/DOMAIN/$hostname/g" /etc/nginx/conf.d/"$hostname".conf
sed -i "s/PHPVERSION/$phpfpm/" /etc/nginx/conf.d/"$hostname".conf
#
# Restarting Nginx and Phpfpm for changes to take effect
# Restarting Nginx and PHP-FPM for changes to take effect
#
printf "\nRestarting services...\n"
systemctl restart "$phpfpm"
systemctl restart nginx
#
# Create postinstall script
# Create post-install script
#
cat > /tmp/dokuwiki-postinstall <<EOF
#!/usr/bin/env bash
@@ -139,7 +138,7 @@ cat > /tmp/dokuwiki-postinstall <<EOF
if [[ $(id -u) -ne 0 ]]; then echo "" && echo "Must be root or use sudo" && echo "" ; exit ; fi
#
# Hardening of DokuWiki
# Harden DokuWiki
#
sed -i 's/^[[:space:]]*#\s*location /location /g' /etc/nginx/conf.d/"$hostname".conf
@@ -157,7 +156,7 @@ EOF
chmod 755 /tmp/dokuwiki-postinstall
#
# DokuWiki postinstall notice
# DokuWiki post-install notice
#
wikinotice=$(cat <<EOF
-----------------------------------------------------------------------------------