Last active
August 10, 2021 14:05
-
-
Save prochor666/060faa1ff91209887972c2a7e4b9e690 to your computer and use it in GitHub Desktop.
Found specific logrotate directive in /etc/logrotate.d/nginx
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 | |
# @author [email protected] | |
# Grep /etc/logrotate.d/nginx file for given string | |
function isPresent() | |
{ | |
if [[ -z "$(grep -i "${@}" /etc/logrotate.d/nginx)" ]]; | |
then | |
echo "ERROR: ${@} not found" | |
else | |
echo "SUCCESS: ${@} found" | |
fi | |
} | |
echo "Grep /etc/logrotate.d/nginx file for given string" | |
echo "" | |
isPresent "Bla/bla/bla/bla.log" | |
isPresent "/var/www/\*/log\/access.log" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment