summaryrefslogtreecommitdiff
path: root/nocompile/bin/ifout
blob: 0884d3cfdedb1115d141f1d430fecff993510d4e (plain) (blame)
1
2
3
4
5
6
#!/bin/sh
if [ "_$(uname -s)" != "_Linux" ];then
 /sbin/route -n get "$1" | grep "interface" | cut -d: -f2 | tr -d ' '
else
 /sbin/ip r g "$1" | tr ' ' '\n' | grep -A1 '^dev$' | tail -n1
fi