aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_print_interfaces.fish
diff options
context:
space:
mode:
authorGravatar Fabian Homborg <FHomborg@gmail.com>2015-09-16 23:01:27 +0200
committerGravatar Fabian Homborg <FHomborg@gmail.com>2015-09-24 15:32:15 +0200
commit79c22c76bffa7d0e5ced234150c7874c783bd72a (patch)
treed8bf94efdee0c06421546533aec2fb3e7b3bcd9e /share/functions/__fish_print_interfaces.fish
parent20e96df85d575261ac65d5354659061e53ef3c3b (diff)
__fish_print_{addresses,interfaces}: Add alternative to net_tools
net_tools, which provides `ifconfig` and `netstat`, among other things, has last been updated in 2013. This means `ifconfig` on linux is basically dead. Instead of ifconfig, use `ip` (from iproute2), which is much more powerful and provides a much more annoying commandline syntax. Instead of netstat, just look at /sys/class/net.
Diffstat (limited to 'share/functions/__fish_print_interfaces.fish')
-rw-r--r--share/functions/__fish_print_interfaces.fish9
1 files changed, 8 insertions, 1 deletions
diff --git a/share/functions/__fish_print_interfaces.fish b/share/functions/__fish_print_interfaces.fish
index cf100056..d9805359 100644
--- a/share/functions/__fish_print_interfaces.fish
+++ b/share/functions/__fish_print_interfaces.fish
@@ -1,3 +1,10 @@
function __fish_print_interfaces --description "Print a list of known network interfaces"
- netstat -i -n -a | awk 'NR>2'|awk '{print $1}'
+ if test -d /sys/class/net
+ cd /sys/class/net
+ for i in *
+ echo $i
+ end
+ else
+ netstat -i -n -a | awk 'NR>2'|awk '{print $1}'
+ end
end