Thanks GazL/giis for pointing out the problem. I corrected that and now i am not seeing "./Demo-PreReq-RHEL.sh: line 10: [: missing `]'" issue.
But i am still seeing below error:
./Demo-PreReq-RHEL.sh: line 24: [: too many arguments
./Demo-PreReq-RHEL.sh: line 84: [: too many arguments
is there any issue with below block of code :
Code:
# Checking RHEL versions
rhel6="cat /etc/redhat-release | grep -o 6"
rhel7="cat /etc/redhat-release | grep -o 7"
OS_VER=""
if [ $rhel6 = 6 ] ==> 24th line
then
OS_VER=6
else
OS_VER=7
fi
And
Code:
# Enable NTP to sync time from "ntp.demo.net"
DNS="10.100.105.11"
get_DNS="cat /etc/resolv.conf | grep -o 10.100.105.11"
if [ $get_DNS = $DNS ] ==> 84th line
then
echo "DNS $DNS is configured."
else
echo "nameserver 10.100.105.11" >> /etc/resolv.conf
fi
Thanks.