Hi all
Yesterday i made a script with funtions, everything worked until 15 minutes ago, and i can't figure out what did go wrong.
I think it has to do something with the 3 first rules of code... but for my opinion that should be fine (i used '777' just to be sure)
Code:
test_mount() {
$touch /current_mount
$chmod 777 /current_mount
$mount | $grep -v none > /current_mount
VAR=`$diff -s /default_mount /current_mount`
echo $VAR var
if [ "$VAR" = "Files /default_mount and /current_mount are identical" ]; then
# OK
value6=0
else
# CRITICAL
value6=2
fi
$rm -f /current_mount
}
so if i run it, i get the critical message... but i shouldn't !!
why do i use all those variables? because they are defined at the beginning of the script, so i have only one place to change them if needed.
i think the rest is clear? probably there is a better way to check mounts, but this is just a quick solution (which isn't working anymore xD
)
so if anyone has a suggestion or something else, i'll be happy to hear it from you
Kind regards