From 19a07588369088871f33fc3cf769f1ec9fe534d4 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Thu, 27 Mar 2008 12:48:37 +0000 Subject: do not write shorewall conf if disabled --- bin/drakguard | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/drakguard b/bin/drakguard index 0d437d8..5b886a5 100755 --- a/bin/drakguard +++ b/bin/drakguard @@ -233,11 +233,13 @@ sub save() { enable_transparent_proxy($proxy_port); services::set_status($_, $enable) foreach qw(squid dansguardian); - $shorewall->{disabled} = 0 if $enable; - $shorewall->{accept_local_user}{http} = $enable && $proxy_user; - $shorewall->{accept_local_user}{$proxy_port} = $enable && $guardian_user; - network::shorewall::set_redirected_ports($shorewall, 'tcp', $guardian_port, if_($enable, 'http', $proxy_port)); - network::shorewall::write($shorewall, $in); + if ($shorewall) { + $shorewall->{disabled} = 0 if $enable; + $shorewall->{accept_local_user}{http} = $enable && $proxy_user; + $shorewall->{accept_local_user}{$proxy_port} = $enable && $guardian_user; + network::shorewall::set_redirected_ports($shorewall, 'tcp', $guardian_port, if_($enable, 'http', $proxy_port)); + network::shorewall::write($shorewall, $in); + } quit_gui(); } -- cgit v1.2.1