You've already forked dokuwiki-ubuntu
new php-fpm check
This commit is contained in:
@@ -14,7 +14,12 @@ if [[ $(id -u) -ne 0 ]]; then echo "" && echo "Must be root or use sudo" && echo
|
||||
# Define variables and functions
|
||||
#
|
||||
hostname="$1"
|
||||
phpver=$(php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;') ; phpfpm="php$phpver-fpm"
|
||||
|
||||
#
|
||||
# Get php-fpm version
|
||||
#
|
||||
phpfpm=$(systemctl list-units --type=service --all | awk '/php[0-9]+\.[0-9]+-fpm/ {print $1; exit}' | sed 's/\.service//')
|
||||
if [[ -z "$phpfpm" ]]; then printf "\nUnable to detect php-fpm version. Is PHP-FPM installed?\n\n" ; exit 1 ; fi
|
||||
|
||||
#
|
||||
# Function usage
|
||||
@@ -72,13 +77,14 @@ chown -R www-data: "$wikidir"
|
||||
# Create a DokuWiki nginx configuration file
|
||||
#
|
||||
cp "$nginxsnippets/hostfiles/dokuwiki.80.conf" /etc/nginx/conf.d/"$hostname".conf
|
||||
sed -i "s/DOMAIN/$hostname/g" /etc/nginx/conf.d/"$hostname".conf
|
||||
sed -i "s/VERSION/$phpver/" /etc/nginx/conf.d/"$hostname".conf
|
||||
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
|
||||
#
|
||||
systemctl restart "$phpfpm" ; systemctl restart nginx
|
||||
systemctl restart "$phpfpm"
|
||||
systemctl restart nginx
|
||||
|
||||
#
|
||||
# Create postinstall script
|
||||
|
||||
Reference in New Issue
Block a user