#!/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() { if( m/^[[:space:]]*/s ) { s/^[[:space:]]*Allow .*$/Allow from $that/s; } if( m /^[[:space:]]*/s ) { s/^[[:space:]]*Allow .*$/Allow from $that/s; } print $_; }