freedombonee/tests/check-cmd-owner.sh

63 lines
1.0 KiB
Bash
Raw Normal View History

#!/bin/bash
if [ -d "/bin" ];then
2017-08-07 11:34:49 +02:00
COUNT=$(find -L /bin \! -user root -exec ls -l {} \; |wc -l)
2017-08-07 11:34:49 +02:00
if [ $COUNT -eq 0 ];then
:
else
exit 1
fi
fi
if [ -d "/usr/bin" ];then
2017-08-07 11:34:49 +02:00
COUNT=$(find -L /usr/bin \! -user root -exec ls -l {} \; |wc -l)
2017-08-07 11:34:49 +02:00
if [ $COUNT -eq 0 ];then
:
else
exit 1
fi
fi
if [ -d "/usr/local/bin" ];then
2017-08-07 11:34:49 +02:00
COUNT=$(find -L /usr/local/bin \! -user root -exec ls -l {} \; |wc -l)
2017-08-07 11:34:49 +02:00
if [ $COUNT -eq 0 ];then
:
else
exit 1
fi
fi
if [ -d "/sbin" ];then
2017-08-07 11:34:49 +02:00
COUNT=$(find -L /sbin \! -user root -exec ls -l {} \; |wc -l)
2017-08-07 11:34:49 +02:00
if [ $COUNT -eq 0 ];then
:
else
exit 1
fi
fi
if [ -d "/usr/sbin" ];then
2017-08-07 11:34:49 +02:00
COUNT=$(find -L /usr/sbin \! -user root -exec ls -l {} \; |wc -l)
2017-08-07 11:34:49 +02:00
if [ $COUNT -eq 0 ];then
:
else
exit 1
fi
fi
if [ -d "/usr/local/sbin" ];then
2017-08-07 11:34:49 +02:00
COUNT=$(find -L /usr/local/sbin \! -user root -exec ls -l {} \; |wc -l)
2017-08-07 11:34:49 +02:00
if [ $COUNT -eq 0 ];then
:
else
exit 1
fi
fi