summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
authorDamien Chaumette <dchaumette@mandriva.com>2004-02-16 17:07:32 +0000
committerDamien Chaumette <dchaumette@mandriva.com>2004-02-16 17:07:32 +0000
commit030c9aba22596778805c534a74649b68a95aecda (patch)
tree4df8569c0d801e12e843ef10a8b62e165d071173 /perl-install/standalone
parent937376d49922a492766b6d54f7a11246fce0c086 (diff)
downloaddrakx-030c9aba22596778805c534a74649b68a95aecda.tar
drakx-030c9aba22596778805c534a74649b68a95aecda.tar.gz
drakx-030c9aba22596778805c534a74649b68a95aecda.tar.bz2
drakx-030c9aba22596778805c534a74649b68a95aecda.tar.xz
drakx-030c9aba22596778805c534a74649b68a95aecda.zip
move check_field's ask_warn() to save_notebook()
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-xperl-install/standalone/drakconnect8
1 files changed, 5 insertions, 3 deletions
diff --git a/perl-install/standalone/drakconnect b/perl-install/standalone/drakconnect
index 2e5afcfb7..abe332abb 100755
--- a/perl-install/standalone/drakconnect
+++ b/perl-install/standalone/drakconnect
@@ -542,7 +542,7 @@ sub save {
my ($netc, $p, $apply_button) = @_;
foreach (keys %$p) {
- save_notebook($netc, $p->{$_}{intf}, $p->{$_}{gui}) or $in->ask_warn(N("Error"), N("IP address should be in format 1.2.3.4")) and return;
+ save_notebook($netc, $p->{$_}{intf}, $p->{$_}{gui}) or return;
$p->{$_}{intf}{save} ? $p->{$_}{intf}{save}->() : apply($netc, $p->{$_}{intf});
}
system("/etc/rc.d/init.d/network restart");
@@ -559,8 +559,10 @@ sub save_notebook {
$gui->{intf_bool}{MII_NOT_SUPPORTED} and $intf->{MII_NOT_SUPPORTED} = bool2yesno(!$gui->{intf_bool}{MII_NOT_SUPPORTED}->get_active);
$gui->{intf_bool}{HWADDR} and (bool2yesno($gui->{intf_bool}{HWADDR}->get_active) eq 'yes' ? ($intf->{HWADDR} = 'yes') : delete $intf->{HWADDR});
- $intf->{BOOTPROTO} eq 'static' and (check_field($intf, 'IPADDR', 'NETMASK') or return 0);
- check_field($netc, 'GATEWAY') or return 0;
+ if ($intf->{BOOTPROTO} eq 'static') {
+ check_field($intf, 'IPADDR', 'NETMASK') or $in->ask_warn(N("Error"), N("IP address should be in format 1.2.3.4")) and return 0;
+ }
+ check_field($netc, 'GATEWAY') or $in->ask_warn(N("Error"), N("Gateway address should be in format 1.2.3.4")) and return 0;
1;
}