#!/usr/bin/perl use File::Copy; # Install r commands # v1.0 17-Aug-2002: basic code # v1.1 25-Mar-2003: code mods for specific customer, forked versions # v1.3 27-Oct-2003: fixes print "fixing the modules.conf\n"; &bcm("/etc/modules.conf"); sub bcm { my $in = shift ; my $out = $in."_prime"; open($fh,"<".$in) || die "Cannot open ".$in ." for reading\n"; open($fh_prime,">".$out) || die "Cannot open ".$out." for writing\n"; while($line=<$fh>) { $line=~s/^alias\s+eth(\d)\s+tg3/alias eth$1 bcm5700/g; printf $fh_prime "%s",$line; } close($fh); close($fh_prime); move($out,$in) || die "Unable to copy ".$out." to ".$in."\n"; }