Skip to content

Instantly share code, notes, and snippets.

@ajayfroiden
Created January 22, 2025 06:36
Show Gist options
  • Save ajayfroiden/b85b369a44e1bc1ebb6e8786f709eeef to your computer and use it in GitHub Desktop.
Save ajayfroiden/b85b369a44e1bc1ebb6e8786f709eeef to your computer and use it in GitHub Desktop.
#!/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