#!/usr/bin/perl package Webconf; require "__WIZ_HOME__/common/scripts/Vareqval.pm"; require "__WIZ_HOME__/common/scripts/DrakconnectConf.pm"; use MDK::Common; use strict; my $o = DrakconnectConf->new(); sub check { $> and return 1; $o->is_dhcp() and return 2; 0; } sub do_it { my $file = "/etc/httpd/conf/commonhttpd.conf"; my $that = "localhost"; if ($ENV{wiz_web_external} eq "1") { $that = "all"; } elsif ($ENV{wiz_web_internal} eq "1") { ($that) = $o->get_from_known_dev("IP") =~ qr/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.)\d{1,3}$/; $that .= " 127.0.0.1"; } cp_af($file, $file.".orig"); substInFile { if( m /^\s*/s ) { { s /^\s*Allow .*$/ Allow from $that\n/s;} ;} if( m /^\s*/s ) { { s /^\s*Allow .*$/ Allow from $that\n/s;} ;} } $file; system("/etc/rc.d/init.d/httpd restart"); 10; } 1;