Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: basesrc/sbin/route



Module Name:    basesrc
Committed By:   atatat
Date:           Wed Oct 24 18:40:17 UTC 2001

Modified Files:
        basesrc/sbin/route: route.8 route.c

Log Message:
Provide a short output format for the get command that only prints the
address corresponding to RTA_GATEWAY, or nothing if it doesn't exist.
Modify the exit value of route depending on this, so that one can do
stuff like:

#!/bin/sh
gw=`route -sn get default 2>/dev/null`
if [ -z "$gw" ]; then
        echo no default route
        exit 1
fi
ping -w1 -c1 $gw >/dev/null 2>&1
if ! route -sn get $gw >/dev/null; then
        echo default gateway not responding
        exit 1
fi
echo default gateway is at $gw


To generate a diff of this commit:
cvs rdiff -r1.25 -r1.26 basesrc/sbin/route/route.8
cvs rdiff -r1.49 -r1.50 basesrc/sbin/route/route.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index