summaryrefslogtreecommitdiffstats
path: root/dhcp_wizard
diff options
context:
space:
mode:
authorArnaud Desmons <adesmons@mandriva.com>2002-09-03 13:28:28 +0000
committerArnaud Desmons <adesmons@mandriva.com>2002-09-03 13:28:28 +0000
commit2a0c44a89ff2ebd4e3de5fa7e3cfc82c23706eff (patch)
tree48996e6f444a404d4b9c7ed51e371024469af2df /dhcp_wizard
parent62086547910b4f73ae63c8c349a20f2718426e2f (diff)
downloaddrakwizard-2a0c44a89ff2ebd4e3de5fa7e3cfc82c23706eff.tar
drakwizard-2a0c44a89ff2ebd4e3de5fa7e3cfc82c23706eff.tar.gz
drakwizard-2a0c44a89ff2ebd4e3de5fa7e3cfc82c23706eff.tar.bz2
drakwizard-2a0c44a89ff2ebd4e3de5fa7e3cfc82c23706eff.tar.xz
drakwizard-2a0c44a89ff2ebd4e3de5fa7e3cfc82c23706eff.zip
some fillfunc
Diffstat (limited to 'dhcp_wizard')
-rw-r--r--dhcp_wizard/dhcp.wiz4
-rw-r--r--dhcp_wizard/scripts/Dhcpconf.pm20
2 files changed, 21 insertions, 3 deletions
diff --git a/dhcp_wizard/dhcp.wiz b/dhcp_wizard/dhcp.wiz
index 7eee4efe..8a2d9ac3 100644
--- a/dhcp_wizard/dhcp.wiz
+++ b/dhcp_wizard/dhcp.wiz
@@ -90,7 +90,7 @@
<Freetext
name="dhcpIpLow"
variableName="dhcp_range_low"
- fillScript="__WIZ_HOME__/dhcp_wizard/scripts/compute_range1.sh"
+ fillfunc="compute_range"
helpText="Lowest IP Address:"
editable="true"
>
@@ -99,7 +99,7 @@
<Freetext
name="dhcpIpHigh"
variableName="dhcp_range_high"
- fillScript="__WIZ_HOME__/dhcp_wizard/scripts/compute_range2.sh"
+ fillfunc="compute_range2"
helpText="Highest IP Address:"
editable="true"
>
diff --git a/dhcp_wizard/scripts/Dhcpconf.pm b/dhcp_wizard/scripts/Dhcpconf.pm
index ad34c59a..8fd15aef 100644
--- a/dhcp_wizard/scripts/Dhcpconf.pm
+++ b/dhcp_wizard/scripts/Dhcpconf.pm
@@ -26,9 +26,27 @@ use strict;
use standalone;
my $o = DrakconnectConf->new();
+my $wiz_ip_server = $o->get_from_known_dev("IP");
+my $d = "$4" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/;
+my $s = "$1.$2.$3" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/;
+
+sub compute_range {
+ my $n;
+ if ($d <= 64) { $n = "65" }
+ elsif ($d <= 128) { $n = "129" }
+ else { $n = "1"}
+ "$s.$n";
+}
+
+sub compute_range2 {
+ my $n;
+ if ($d <= 128) { $n = "254" }
+ elsif ($d > 192) { $n = "192" }
+ else { $n = "128"}
+ "$s.$n";
+}
sub do_it {
- my $wiz_ip_server = $o->get_from_known_dev("IP");
my $wiz_domain_name = $o->get("DomainName");
my $wiz_host_name = $o->get("SystemName");
my $wiz_ip_net = "$1.$2.$3.0" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/;