Package: iproute
Version: 20090324-1
Severity: wishlist

I'm trying to test for the presence of a default route. Unfortunately I
can't just use

  if ip route show 0.0.0.0/0 >/dev/null; then
    echo "Have default"
  fi

because 'ip route show' exits 0 regardless:

  $ ip route show 0.0.0.0/0 ; echo $?
  default via 192.168.2.1 dev eth0 
  0

  $ ip route show 0.0.4.0/1 ; echo $?
  0

Perhaps it could exit some non-zero status if no routes were found?


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.30-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages iproute depends on:
ii  libc6                         2.10.2-2   GNU C Library: Shared libraries
ii  libdb4.7                      4.7.25-8   Berkeley v4.7 Database Libraries [

Versions of packages iproute recommends:
pn  libatm1                       <none>     (no description available)

Versions of packages iproute suggests:
pn  iproute-doc                   <none>     (no description available)

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to