Created
February 6, 2019 15:13
-
-
Save danitfk/cd8a2b8ff0c34dc43cc123aa32a300d5 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 | |
LOADAVG=$(cat /proc/loadavg | awk {'print $3'} | cut -d. -f1) | |
SERVICES="mysql | |
httpd" | |
if [ "$LOADAVG" -gt 10 ]; then | |
for service in $SERVICES | |
do | |
echo "Restart $service" | |
systemctl restart $service | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment