24 |
die "device $dev not up: ifconfig $dev\n$ifconfig" unless $ifconfig =~ m/UP/; |
die "device $dev not up: ifconfig $dev\n$ifconfig" unless $ifconfig =~ m/UP/; |
25 |
$ip = $1 if $ifconfig =~ m/inet addr:(\S+)/s; |
$ip = $1 if $ifconfig =~ m/inet addr:(\S+)/s; |
26 |
$netmask = $1 if $ifconfig =~ m/Mask:(\S+)/s; |
$netmask = $1 if $ifconfig =~ m/Mask:(\S+)/s; |
27 |
$bcast = $1 if $ifconfig =~ m/Bcast:(\S)/s; |
$bcast = $1 if $ifconfig =~ m/Bcast:(\S+)/s; |
28 |
} |
} |
29 |
|
|
30 |
warn "DEV $ip $bcast $netmask"; |
warn "DEV $ip $bcast $netmask"; |