Hello,
I'm trying to get this piece of script working, but I'm having an issue on my script. The
if [ $DEV_ORA -eq 0 ] is not get run when I run my script. I do not know what I'm doing wrong here. Basically I trying to run the second if "ORA_ASM" is found on the $DEV_ORA.
Thanks a lot guys
#!/bin/bash
DEV_ORA=$( grep -ic ORA /etc/multipath.conf )
# RH5 ORA_ASM
if grep -q -i "release 5" /etc/redhat-release
then
echo "Red Hat Release 5"
ls -l /dev/mapper/mpath* | egrep -v "mpath0|p1" | awk '{print $10}'> /tmp/dump.txt
if [ $DEV_ORA -eq 0 ]
then
ls -l /dev/mapper/ORA* | grep -v p1 | awk '{print $10}' >> /tmp/dump.txt
echo "Found Oracle ASM DISK"
fi
# RH6 ORA_ASM
if grep -q -i "release 6" /etc/redhat-release
then
echo "Red Hat Release 6"
ls -l /dev/mapper/mpath* | egrep -v "mpath0|mpatha|p1" | awk '{print $9}'> /tmp/dump.txt
if [ $DEV_ORA -eq 0 ]
then
ls -l /dev/mapper/ORA*|grep -v p1 |awk '{print $9}'>> /tmp/dum.txt
echo "Found Oracle ASM DISK"
else
echo "Running neither RHEL6.x nor RHEL 5.x !"
fi