summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaud Desmons <adesmons@mandriva.com>2002-08-29 16:12:19 +0000
committerArnaud Desmons <adesmons@mandriva.com>2002-08-29 16:12:19 +0000
commitf411f9a01aa8392e49f5305fb71eb787c85afea4 (patch)
tree908dbb960b07534d0c827225a8df796186d8c7e7
parent55166f55f9867921aa3f013e22681b0cff8f54db (diff)
downloaddrakwizard-f411f9a01aa8392e49f5305fb71eb787c85afea4.tar
drakwizard-f411f9a01aa8392e49f5305fb71eb787c85afea4.tar.gz
drakwizard-f411f9a01aa8392e49f5305fb71eb787c85afea4.tar.bz2
drakwizard-f411f9a01aa8392e49f5305fb71eb787c85afea4.tar.xz
drakwizard-f411f9a01aa8392e49f5305fb71eb787c85afea4.zip
append INTERFACE in /etc/sysconfig/dhcpd only if not already in
-rw-r--r--dhcp_wizard/scripts/Dhcpconf.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/dhcp_wizard/scripts/Dhcpconf.pm b/dhcp_wizard/scripts/Dhcpconf.pm
index 6fe5045f..ad34c59a 100644
--- a/dhcp_wizard/scripts/Dhcpconf.pm
+++ b/dhcp_wizard/scripts/Dhcpconf.pm
@@ -31,7 +31,7 @@ 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" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/;
+ my $wiz_ip_net = "$1.$2.$3.0" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/;
my $wiz_ip_range1 = $ENV{wiz_ip_range1};
my $wiz_ip_range2 = $ENV{wiz_ip_range2};
my $wiz_ip_netmask = $o->get_from_known_dev("Mask");
@@ -43,12 +43,12 @@ sub do_it {
#[ -f /etc/sysconfig/dhcpd ] && cp -f /etc/sysconfig/dhcpd /var/tmp/wiz_bck/orig/dhcpd
my $file = "/etc/sysconfig/dhcpd";
MDK::Common::cp_af($file, $file.".orig");
- MDK::Common::append_to_file($file, "INTERFACES=$wiz_device");
$file = "/etc/rc.d/init.d/dhcpd";
# now patching etc/rc.d/init.d/dhcpd
standalone::explanations("now patching etc/rc.d/init.d/dhcpd");
if (!`grep INTERFACES $file`){
+ MDK::Common::append_to_file($file, "\nINTERFACES=$wiz_device");
MDK::Common::cp_af($file, $file . ".orig");
my $tmp = `mktemp /tmp/Dhcpconf.XXXXXX` or die "can't make a temp file: $!";
open(NEW, "> $tmp") or die "can't open $tmp: $!";