From 1cac25d7ec30e9a8d80208ee89ce83dd679f79be Mon Sep 17 00:00:00 2001 From: short <> Date: Sat, 16 Oct 2004 09:43:44 +0000 Subject: [PATCH] Support interfaces name expansion syntax: eth{0-1}.{2-24} --- harpy | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/harpy b/harpy index cb02bd2..1c314e1 100755 --- a/harpy +++ b/harpy @@ -183,7 +183,13 @@ my($msg)=@_; my %socks; -for my $ifname (@ARGV) { +my @ifnames=@ARGV; +while (@ifnames) { + my $ifname=shift @ifnames; + if ($ifname=~/{(\d+)-(\d+)}/) { + push @ifnames,$`.$_.$' for $1..$2; + next; + } my($sock,$hw)=sock($ifname); $socks{$ifname}={ "sock"=>$sock, -- 1.8.3.1