Optimize OS/release/version detection for faster execution #70

Merged
benpro merged 86 commits from fast-debian-check into master 2019-04-05 11:01:57 +02:00
Showing only changes of commit 9dcdd8202e - Show all commits

View file

@ -403,13 +403,17 @@ if is_debian; then
fi
if [ "$IS_NRPEPERMS" = 1 ]; then
test -d /etc/nagios && ls -ld /etc/nagios | grep -q "drwxr-x---" \
|| failed "IS_NRPEPERMS"
if test -d /etc/nagios; then
actual=$(stat --format "%A" /etc/nagios)
expected="drwxr-x---"
test "$expected" = "$actual" || failed "IS_NRPEPERMS"
fi
fi
if [ "$IS_MINIFWPERMS" = 1 ]; then
ls -l "$MINIFW_FILE" | grep -q -- "-rw-------" \
|| failed "IS_MINIFWPERMS"
actual=$(stat --format "%A" $MINIFW_FILE)
expected="-rw-------"
test "$expected" = "$actual" || failed "IS_MINIFWPERMS"
fi
if [ "$IS_NRPEDISKS" = 1 ]; then