diff --git a/bin/test_logrotate.sh b/bin/test_logrotate.sh new file mode 100755 index 0000000..5b81a5b --- /dev/null +++ b/bin/test_logrotate.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# [[ $(whoami) == 'root' ]] || { echo 'Please run this script as root'; exit 1; } + +sudo logrotate --debug /etc/logrotate.conf +if [ "$?" != 0 ]; then + echo + echo "There is an error in one or more logrotate snipplets" >&2 + echo + exit 1 +fi diff --git a/bin/test_validate.sh b/bin/test_validate.sh index edaebf5..53ec755 100755 --- a/bin/test_validate.sh +++ b/bin/test_validate.sh @@ -10,6 +10,7 @@ TESTS=( secrets.sh roles.py custom_grains.py + logrotate.sh ) for _test in ${TESTS[@]}; do