You've already forked Atomcms-edit
fix: auto-restart via PM2 fallback when systemd not found
This commit is contained in:
+8
-4
@@ -320,7 +320,8 @@ fi
|
|||||||
# ----------------------------------------
|
# ----------------------------------------
|
||||||
# 7. Restart the Service (only if updates were applied)
|
# 7. Restart the Service (only if updates were applied)
|
||||||
# ----------------------------------------
|
# ----------------------------------------
|
||||||
if [ "$HAD_UPDATES" = true ] && systemctl cat "$EMULATOR_SERVICE" &>/dev/null; then
|
if [ "$HAD_UPDATES" = true ]; then
|
||||||
|
if systemctl cat "$EMULATOR_SERVICE" &>/dev/null; then
|
||||||
echo "--> Restarting $EMULATOR_SERVICE service..."
|
echo "--> Restarting $EMULATOR_SERVICE service..."
|
||||||
if command -v sudo &> /dev/null; then
|
if command -v sudo &> /dev/null; then
|
||||||
sudo systemctl restart "$EMULATOR_SERVICE"
|
sudo systemctl restart "$EMULATOR_SERVICE"
|
||||||
@@ -328,9 +329,12 @@ if [ "$HAD_UPDATES" = true ] && systemctl cat "$EMULATOR_SERVICE" &>/dev/null; t
|
|||||||
else
|
else
|
||||||
echo "--> Sudo not available. Restart the service manually: sudo systemctl restart $EMULATOR_SERVICE"
|
echo "--> Sudo not available. Restart the service manually: sudo systemctl restart $EMULATOR_SERVICE"
|
||||||
fi
|
fi
|
||||||
else
|
elif command -v pm2 &> /dev/null; then
|
||||||
echo "--> Warning: Service '$EMULATOR_SERVICE' not found in systemd."
|
echo "--> Restarting PM2 processes..."
|
||||||
echo "--> If you use PM2, restart your processes manually: pm2 restart all"
|
pm2 restart all
|
||||||
|
else
|
||||||
|
echo "--> Warning: Neither systemd nor PM2 found. Restart the emulator manually."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user