Created
January 21, 2016 21:06
-
-
Save darookee/0d677a44eecc711fbdb0 to your computer and use it in GitHub Desktop.
Check for large mailq, stop postfix, send pusbullet notification
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 | |
| mailsinqueue=$(mailq 2> /dev/null|egrep "^[A-Z0-9]{11}[[:space:]].*" -c) | |
| if [ "$mailsinqueue" -gt "15" ]; then | |
| postfix status 1&>2 > /dev/null || exit 0 | |
| postfix stop 1&>2 > /dev/null | |
| echo "SPAM!" | /usr/bin/pb 2> /dev/null | |
| exit 1 | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment