4 $networkscriptdir=$ARGV[1];
6 open(INTERFACES,"$interfaces") || die "interfaces: $interfaces $!\n";
8 chdir($networkscriptdir) || die "Can not chdir to $networkscriptdir: $!\n";
17 if(/^\s*address\s*([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*)/) {
18 print IFCFG "IPADDR=$1\n";
20 } elsif(/^\s*network\s*([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*)/) {
21 print IFCFG "NETMASK=$1\n";
23 } elsif(/^\s*netmask\s*([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*)/) {
24 print IFCFG "NETMASK=$1\n";
26 } elsif(/^\s*broadcast\s*([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*)/) {
27 print IFCFG "BROADCAST=$1\n";
29 } elsif(/^\s*gateway\s*([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*)/) {
30 print IFCFG "GATEWAY=$1\n";
31 print IFCFG "GATEWAYDEV=$device\n";
32 } elsif(/^\s*up\s*route\s*add\s*-(.*)/) {
33 open(STATICROUTES, ">>../static-routes") || die "can not open ../static-routes: $!\n";
34 print STATICROUTES "$device $1\n";
44 print STDERR "ignoring command $_\n";
49 #print "Processing $_\n";
50 if(/\s*iface (.*) inet static/) {
53 open(IFCFG, ">ifcfg-$device") || die "Can not open ifcfg-$device: $!\n";
54 print IFCFG "ONBOOT=yes\n";