Last active
March 27, 2017 02:27
-
-
Save itkq/c8e28dd5ac52baa713c688ce5bb0e69e to your computer and use it in GitHub Desktop.
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 | |
ls /var/log/nginx/access.log-*.gz | tail -n 1 \ | |
| xargs zgrep 404 | egrep 'php|admin|db|sql|struts' | awk '{print $1}' | uniq \ | |
| awk '{$0="deny " $0 ";"; print}' >> /etc/nginx/dropip.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment