Created
January 22, 2025 06:36
-
-
Save ajayfroiden/b85b369a44e1bc1ebb6e8786f709eeef to your computer and use it in GitHub Desktop.
This file contains hidden or 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 if Apache is running | |
if systemctl is-active --quiet apache2; then | |
echo "Apache is running." | |
else | |
echo "Apache is not running. Restarting Apache..." | |
sudo systemctl restart apache2 | |
echo "Apache has been restarted." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment