Last active
November 8, 2018 06:50
-
-
Save mklooss/6d2f52c1f4a646117341acf8523e845b to your computer and use it in GitHub Desktop.
nginx / letsencrypt check
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 | |
sleep 10 | |
PSAUX=$(ps aux | grep nginx | grep -v grep) | |
if [ -z "$PSAUX" ]; then | |
/etc/init.d/nginx stop | |
PID=$(netstat -tulnop | grep 443 | awk '{print $7}' | awk -F "/" '{print $1}' | xargs) | |
for p in $PID; do | |
echo $p | |
kill -9 $p | |
done | |
/etc/init.d/nginx start | |
fi |
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
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
MAILTO=root | |
0 4,7 * * * root /usr/local/sbin/letsencrypt-update-failed.sh > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment