#!/usr/local/bin/perl
# apply.cgi
# Apply the current firewall configuration

require './firewall-lib.pl';
&ReadParse();
&error_setup($text{'apply_err'});
if (defined(&apply_iptables)) {
	# Call distro's apply command
	$err = &apply_iptables();
	}
else {
	# Manually run iptables-restore
	$out = &backquote_logged("cd / ; iptables-restore <$iptables_save_file 2>&1");
	$err = "<pre>$out</pre>" if ($?);
	}
&error($err) if ($err);
&webmin_log("apply");
&redirect("index.cgi?table=$in{'table'}");

