Skip to content

Commit

Permalink
Fix restart and status check script.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zifah authored Aug 5, 2024
1 parent b40f204 commit bbaef43
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/api-deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ jobs:
sudo systemctl restart $SERVICE_NAME
sleep 3
STATUS=\$(sudo systemctl is-active $SERVICE_NAME)
echo "The service $SERVICE_NAME is currently $STATUS"
if [ $STATUS != 'active' ]; then
echo 'The service $SERVICE_NAME is currently \$STATUS'
if [ -z \$STATUS]; then
echo 'Service status is empty or not defined'
exit 1
elif [ \$STATUS != 'active' ]; then
sudo systemctl status $SERVICE_NAME --no-pager
exit 1
else
Expand Down

0 comments on commit bbaef43

Please sign in to comment.