x="PermitRootLogin no"
cd /etc/ssh
y=`cat sshd_config |grep "PermitRootLogin"`
if [[ "$x" = "$y" ]]
then print "Sorry, Remote Root SSH login already disabled."
exit
else print "Welcome to Remote SSH Login disable script."
fi
output:
+ x=PermitRootLogin no
+ cd /etc/ssh
+ + cat sshd_config
y=PermitRootLogin no
+ [[ PermitRootLogin no = PermitRootLogin no ]]
+print " Welcome to Remote Root SSH Login disable script.
Welcome to Remote Root SSH Login disable script.
Here both $x=$y=PermitRootLogin no. Still it is executing as if $x!=$y ???
I worked around in another way,,but can someone tell me what is wrong with this damn script??
thanks in advance.