summaryrefslogtreecommitdiffstats
path: root/web_wizard/scripts/mytest.pl
blob: e13f3708f3748640b7d9033850218d02564a41bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/perl
use strict;

open(FH, $ARGV[0]);

my	$that;

if ($ENV{wiz_web_external} eq "1") {
    $that = "all";
}
elsif ($ENV{wiz_web_internal} eq "1") {
    $that = $ip;
}
else {
    $that = "localhost";
}


while(<FH>) {
    if( m/^[[:space:]]*<Directory \/home/s...m/^[[:space:]]*<\/Directory>/s ) {
	s/^[[:space:]]*Allow .*$/Allow from $that/s;
    }
    if( m /^[[:space:]]*<Directory \/var\/www/s...m/^[[:space:]]*<\/Directory>/s ) {
	s/^[[:space:]]*Allow .*$/Allow from $that/s;
    }
    print $_;
}