summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-03-27 12:48:37 +0000
committerOlivier Blin <oblin@mandriva.com>2008-03-27 12:48:37 +0000
commit19a07588369088871f33fc3cf769f1ec9fe534d4 (patch)
tree42f733a008af2768b0a00b4d235aa4244c5d27ce /bin
parentff9341a2ed4df2b8dd3efdf0ad76ca0131fbfd7d (diff)
downloaddrakguard-19a07588369088871f33fc3cf769f1ec9fe534d4.tar
drakguard-19a07588369088871f33fc3cf769f1ec9fe534d4.tar.gz
drakguard-19a07588369088871f33fc3cf769f1ec9fe534d4.tar.bz2
drakguard-19a07588369088871f33fc3cf769f1ec9fe534d4.tar.xz
drakguard-19a07588369088871f33fc3cf769f1ec9fe534d4.zip
do not write shorewall conf if disabled
Diffstat (limited to 'bin')
-rwxr-xr-xbin/drakguard12
1 files changed, 7 insertions, 5 deletions
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();
}