diff options
author | Arnaud Desmons <adesmons@mandriva.com> | 2002-08-02 07:57:19 +0000 |
---|---|---|
committer | Arnaud Desmons <adesmons@mandriva.com> | 2002-08-02 07:57:19 +0000 |
commit | 4eff908ea23a53d50f348a01d56911594544bb25 (patch) | |
tree | 69d5a8c1fa23e9542168295fad8bead0ec1b0b41 /server_wizard | |
parent | ed80980bfe10c79b8a9356bc644ac5ae2f1b6dfc (diff) | |
download | drakwizard-4eff908ea23a53d50f348a01d56911594544bb25.tar drakwizard-4eff908ea23a53d50f348a01d56911594544bb25.tar.gz drakwizard-4eff908ea23a53d50f348a01d56911594544bb25.tar.bz2 drakwizard-4eff908ea23a53d50f348a01d56911594544bb25.tar.xz drakwizard-4eff908ea23a53d50f348a01d56911594544bb25.zip |
mismatched chars and chomps
Diffstat (limited to 'server_wizard')
-rw-r--r-- | server_wizard/scripts/Serverconf.pm | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/server_wizard/scripts/Serverconf.pm b/server_wizard/scripts/Serverconf.pm index 29bd4803..4f70e74a 100644 --- a/server_wizard/scripts/Serverconf.pm +++ b/server_wizard/scripts/Serverconf.pm @@ -18,6 +18,7 @@ wiz_domain_name=$ENV{wiz_domain_name}"; } sub do_it { + my $old_ip; my $date = `date`; my $file = "/etc/sysconfig/network"; MDK::Common::cp_af($file, $file . ".orig"); @@ -39,8 +40,8 @@ sub do_it { die "wiz_device not in env"; if (-f $file) { MDK::Common::cp_af($file, $file . ".orig"); - %mdk = Vareqval->get($file); - my $old_ip = $mdk{IPADDR} if defined $mdk{IPADDR} or die "IPADDR not found in $file"; + %mdk = Vareqval->get($file); + $old_ip = $mdk{IPADDR} if defined $mdk{IPADDR} or die "IPADDR not found in $file"; } else { system("touch $file"); @@ -59,7 +60,7 @@ sub do_it { $mdk{IPXNETNUM_802_2} = ""; $mdk{IPXPRIMARY_802_2} = "no"; $mdk{IPXACTIVE_802_2} = "no"; - $mdk{IPXNETNUM_802_3} ""; + $mdk{IPXNETNUM_802_3} = ""; $mdk{IPXPRIMARY_802_3} = "no"; $mdk{IPXACTIVE_802_3} = "no"; $mdk{IPXNETNUM_ETHERII} = ""; @@ -69,7 +70,7 @@ sub do_it { $mdk{IPXPRIMARY_SNAP} = "no"; $mdk{IPXACTIVE_SNAP} = "no"; # chg_val sequence ended - Vareqval->commit($file, \%mdk) + Vareqval->commit($file, \%mdk); $file = "/etc/HOSTNAME"; MDK::Common::cp_af($file, $file . ".orig"); @@ -83,6 +84,7 @@ sub do_it { MDK::Common::cp_af($file, $file . ".orig"); if (defined $old_ip && $old_ip ne $new_ip) { my $tmp = `mktemp /tmp/Serverconf.XXXXXX`; + chomp($tmp); open(OLD, "< $file") or die "can not open $file"; open(NEW, "> $tmp") or die "can not open $tmp"; while (<OLD>) { @@ -94,8 +96,9 @@ $new_ip\t$hostname\t$hostalias\n"; } print NEW $_; } - close OLD, NEW; - system("mv $tmp $file); + close OLD; + close NEW; + system("mv $tmp $file"); } else { open(NEW, ">> $file"); @@ -105,4 +108,7 @@ $new_ip\t$hostname\t$hostalias\n"; do_it_last(); system("/etc/rc.d/init.d/network stop"); system("/etc/rc.d/init.d/network start"); + 10; } + +1; |