linuxMaestro
Instructor
Hi,
I have hardcoded the correct md5sum of /sbin/arp and I want to compare it to the one currently on the server to insure it hasn't been replaced, however it tells me they don't match even though the do. Got any tips?
The script is:
arp="6db3f218870589c77e8dec330ea17222 /sbin/arp"
chkArp=`md5sum /sbin/arp`
echo $arp
echo $chkArp
if [ '$arp' = '$chkArp' ] ; then
echo "/sbin/arp ok"
else
echo "/sbin/arp NOT OK!"
fi
and it yields:
6db3f218870589c77e8dec330ea17222 /sbin/arp
6db3f218870589c77e8dec330ea17222 /sbin/arp
/sbin/arp NOT OK!
Why does my if statement fail?
Thanks in advance.
I have hardcoded the correct md5sum of /sbin/arp and I want to compare it to the one currently on the server to insure it hasn't been replaced, however it tells me they don't match even though the do. Got any tips?
The script is:
arp="6db3f218870589c77e8dec330ea17222 /sbin/arp"
chkArp=`md5sum /sbin/arp`
echo $arp
echo $chkArp
if [ '$arp' = '$chkArp' ] ; then
echo "/sbin/arp ok"
else
echo "/sbin/arp NOT OK!"
fi
and it yields:
6db3f218870589c77e8dec330ea17222 /sbin/arp
6db3f218870589c77e8dec330ea17222 /sbin/arp
/sbin/arp NOT OK!
Why does my if statement fail?
Thanks in advance.