if ( my $dev = $ENV{DEV} ) {
my $ifconfig = `ifconfig $dev`;
die "can't ifconfig $dev" unless $ifconfig;
+ die "device $dev not up: ifconfig $dev\n$ifconfig" unless $ifconfig =~ m/UP/;
$ip = $1 if $ifconfig =~ m/inet addr:(\S+)/s;
$netmask = $1 if $ifconfig =~ m/Mask:(\S+)/s;
$bcast = $1 if $ifconfig =~ m/Bcast:(\S)/s;