From 0d2869ecf2550389126de00dbd4284782448ed83 Mon Sep 17 00:00:00 2001 From: Arghya Biswas Date: Sat, 6 Sep 2025 20:30:07 +0530 Subject: [PATCH] Added a new script to restart the services gressfully Signed-off-by: Arghya Biswas --- config.yaml | 2 +- restartServices.sh | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 restartServices.sh diff --git a/config.yaml b/config.yaml index 613ca3e..88857ba 100644 --- a/config.yaml +++ b/config.yaml @@ -1,2 +1,2 @@ -appVersion: 1.8.0.1015 +appVersion: 1.8.1.1016 maxCount : 7500000 diff --git a/restartServices.sh b/restartServices.sh new file mode 100755 index 0000000..bdbfd7a --- /dev/null +++ b/restartServices.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +SERVICES=("spring-loaded-switch-php.service" "spring-loaded-switch-python.service") + +echo "Checking status before restart..." +for SERVICE in "${SERVICES[@]}"; do + echo "Status of $SERVICE:" + sudo systemctl status "$SERVICE" --no-pager + echo "-----------------------------" +done + +echo "Restarting services..." +for SERVICE in "${SERVICES[@]}"; do + if ! sudo systemctl restart "$SERVICE"; then + echo "ERROR: Failed to restart $SERVICE" >&2 + fi +done + +echo "Checking status after restart..." +for SERVICE in "${SERVICES[@]}"; do + echo "Status of $SERVICE:" + sudo systemctl status "$SERVICE" --no-pager + echo "-----------------------------" +done