Created
January 17, 2023 10:27
-
-
Save yazanmonshed/7836e78c2b433cda3a044324d4878ade to your computer and use it in GitHub Desktop.
Check status service using Bash script with Jenkins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check the status of the service | |
# Pass as param from Jenkins Server | |
service=$1 | |
if systemctl is-active --quiet $service; then | |
echo "$service is running." | |
else | |
echo "$service is not running." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment