Hello
I'm trying to run this script count_files:
WARNING_STATE=1
CRITICAL_STATE=2
file_count=0file_count=`ls /number/files/ | wc -l`if [ $file_count -gt 15 ]
then
echo "WARNING:" $file_count "files"
exit $WARNING_STATE
fiif [ $file_count -gt 25 ]
then
echo "CRITICAL:" $file_count "files"
exit $CRITICAL_STATE
fi
echo "OK:" $file_count "files"
exit $OK_STATE
The result should gives a number of files, but after many tests it doesn't work ok
it always returns this error:
./count_files: [: : integer expression expected
./count_files: line 11: syntax error near unexpected token `then'
./count_files: line 11: `then'
Can someone help me?
Thank you for advanced