From 3d7aab11491436c8f833cd22d068596a2d342b7a Mon Sep 17 00:00:00 2001 From: tgoff0 Date: Wed, 21 Jan 2015 21:37:52 +0000 Subject: [PATCH] daemon: Use interface names from /sys/class/net when it exists. --- daemon/sbin/core-cleanup | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/daemon/sbin/core-cleanup b/daemon/sbin/core-cleanup index dca35da2..0eace227 100755 --- a/daemon/sbin/core-cleanup +++ b/daemon/sbin/core-cleanup @@ -44,7 +44,13 @@ killall -q emane killall -q emanetransportd killall -q emaneeventservice -ifconfig -a | awk ' +if [ -d /sys/class/net ]; then + ifcommand="ls -1 /sys/class/net" +else + ifcommand="ifconfig -a" +fi + +eval "$ifcommand" | awk ' /^veth[0-9]+\./ {print "removing interface " $1; system("ip link del " $1);} /tmp\./ {print "removing interface " $1; system("ip link del " $1);} /gt\./ {print "removing interface " $1; system("ip link del " $1);}