fix for bug 3471: print message if the persistent route does not exist

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@15863 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
ligc 2013-04-08 07:11:43 +00:00
parent be14247f0e
commit ad308476bd

View File

@ -227,9 +227,16 @@ rm_persistent_route()
route1="$net $gw $mask";
fi
if [ -f $filename ]; then
sed -i -e s/"$route1"//g $filename
fi
echo "Persistent route \"$route\" removed from $filename."
grep "$route" $filename 2>&1 1>/dev/null
if [ $? -ne 0 ]; then # Does not exist in file
echo "Persistent route \"$route\" does not exist in $filename."
else
sed -i -e s/"$route1"//g $filename
echo "Persistent route \"$route\" removed from $filename."
fi
else
echo "Persistent route file $filename does not exist."
fi
;;
ubuntu*)
echo "Removing persistent route on Ubuntu is not supported yet."
@ -249,9 +256,16 @@ rm_persistent_route()
route1="any net $net netmask $mask gw $gw $ifname";
fi
if [ -f $filename ]; then
sed -i -e s/"$route"//g $filename
fi
echo "Persistent route \"$route1\" removed from $filename."
grep "$route" $filename 2>&1 1>/dev/null
if [ $? -ne 0 ]; then # Does not exist in file
echo "Persistent route \"$route1\" does not exist in $filename."
else
sed -i -e s/"$route"//g $filename
echo "Persistent route \"$route1\" removed from $filename."
fi
else
echo "Persistent route file $filename does not exist."
fi
;;
esac
else #AIX