]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ip/routef lifesaver
authorMike Frysinger <vapier@gentoo.org>
Sat, 15 Jul 2006 07:31:48 +0000 (03:31 -0400)
committerStephen Hemminger <shemminger@linux-foundation.org>
Wed, 11 Jul 2007 01:29:20 +0000 (18:29 -0700)
keep people from screwing their systems with routef

minor patch here ... if you run `routef --help`,
it'll turn around and flush your routing tables anyways :)

so patch will have routef output usage if any arguments are given,
otherwise it'll flush the tables ... idea is from Lars Strojny

ip/routef

index db43b5dff63075d2dd6af548f983df81807c019b..d266e2d9725ff872067dc0035f530bf18b3230a1 100644 (file)
--- a/ip/routef
+++ b/ip/routef
@@ -1,3 +1,9 @@
 #! /bin/sh
 
-exec ip -4 ro flush  scope global  type unicast
+if [ -z "$*" ] ; then
+       exec ip -4 ro flush  scope global  type unicast
+else
+       echo "Usage: routef"
+       echo
+       echo "This script will flush the IPv4 routing table"
+fi