script question
I want to delete a route in case it exists.
My script is: if ip route | grep "80.0.0.0/8 dev ipsec0" then ip route del 80.0.0.0/8 dev ipsec0 logger -i -t myscript -- deleted else logger -i -t myscript -- not deleted fi exit 0 I'm running this every 10 minutes with a cronjob. /bin/sh /tmp/myscript Even if the route exists it tells me "not deleted". If I run the script from the command line it deletes the route. Any ideas why? |
forgot to mention:
I'm getting an error message ip: command not found so I guess the line if ip route | grep .... is the problem. |
Hi,
does specifying the full path (such as /sbin/ip) in the script help? |
Hi millgates,
it worked with the full path. Thank you so much. |
All times are GMT -5. The time now is 10:10 AM. |