summaryrefslogtreecommitdiffstats
path: root/server_wizard
diff options
context:
space:
mode:
Diffstat (limited to 'server_wizard')
-rw-r--r--server_wizard/scripts/Serverconf.pm18
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;