summaryrefslogtreecommitdiffstats
path: root/dhcp_wizard/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'dhcp_wizard/scripts')
-rw-r--r--dhcp_wizard/scripts/Dhcpconf.pm20
1 files changed, 19 insertions, 1 deletions
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})/;