fix: improve bunkerweb service management in postinstall script

This commit is contained in:
Théophile Diot 2024-11-28 13:48:45 +01:00
parent 5236e3e329
commit a9792cb047
No known key found for this signature in database
GPG key ID: FA995104A0BA376A

View file

@ -83,20 +83,23 @@ else
echo "/var/www/html directory already exists, skipping copy..."
fi
if [ -f /var/tmp/bunkerweb_upgrade ]; then
# Reload bunkerweb service
echo "Reloading bunkerweb service..."
do_and_check_cmd systemctl reload bunkerweb
else
# Stop and disable nginx on boot
echo "Stop and disable nginx on boot..."
do_and_check_cmd systemctl stop nginx
do_and_check_cmd systemctl disable nginx
# Create bunkerweb if needed
if [ "$SERVICE_BUNKERWEB" != "no" ] ; then
if [ -f /var/tmp/bunkerweb_upgrade ]; then
# Reload bunkerweb service
echo "Reloading bunkerweb service..."
do_and_check_cmd systemctl reload bunkerweb
else
# Stop and disable nginx on boot
echo "Stop and disable nginx on boot..."
do_and_check_cmd systemctl stop nginx
do_and_check_cmd systemctl disable nginx
# Auto start BW service on boot and start it now
echo "Enabling and starting bunkerweb service..."
do_and_check_cmd systemctl enable bunkerweb
do_and_check_cmd systemctl start bunkerweb
# Auto start BW service on boot and start it now
echo "Enabling and starting bunkerweb service..."
do_and_check_cmd systemctl enable bunkerweb
do_and_check_cmd systemctl start bunkerweb
fi
fi
# Create scheduler if necessary