Skip to content

Commit

Permalink
fix: add checks for active services before reloading or restarting bu…
Browse files Browse the repository at this point in the history
…nkerweb and scheduler
  • Loading branch information
TheophileDiot committed Nov 28, 2024
1 parent 3e5e269 commit 7619846
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/linux/scripts/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ fi
# 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
if systemctl is-active --quiet bunkerweb; then
# Reload bunkerweb service
echo "Reloading bunkerweb service..."
do_and_check_cmd systemctl reload bunkerweb
fi
else
# Stop and disable nginx on boot
echo "Stop and disable nginx on boot..."
Expand All @@ -108,10 +110,12 @@ fi

# Create scheduler if necessary
if [ "$SERVICE_SCHEDULER" != "no" ] ; then
if [ -f /var/tmp/bunkerweb_upgrade ] && systemctl is-active --quiet bunkerweb-scheduler; then
# Reload bunkerweb-scheduler service
echo "Restarting bunkerweb-scheduler service..."
do_and_check_cmd systemctl restart bunkerweb-scheduler
if [ -f /var/tmp/bunkerweb_upgrade ]; then
if systemctl is-active --quiet bunkerweb-scheduler; then
# Reload bunkerweb-scheduler service
echo "Restarting bunkerweb-scheduler service..."
do_and_check_cmd systemctl restart bunkerweb-scheduler
fi
else
# Auto start BW Scheduler service on boot and start it now
echo "Enabling and starting bunkerweb service..."
Expand Down

0 comments on commit 7619846

Please sign in to comment.