1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

Fix writing of the firewall config

This commit is contained in:
Christian Zeitnitz 2021-07-20 18:13:35 +02:00
parent 5197df18e1
commit 721e576779

View File

@ -3,7 +3,7 @@
require_once 'includes/status_messages.php'; require_once 'includes/status_messages.php';
require_once 'includes/functions.php'; require_once 'includes/functions.php';
define(RASPAP_IPTABLES_SCRIPT,"/tmp/iptables_raspap.sh"); define('RASPAP_IPTABLES_SCRIPT',"/tmp/iptables_raspap.sh");
function getDependson(&$rule, &$conf) { function getDependson(&$rule, &$conf) {
if ( isset($rule["dependson"][0]) ) { if ( isset($rule["dependson"][0]) ) {
@ -103,14 +103,9 @@ function configureFirewall() {
} }
function WriteFirewallConf($conf) { function WriteFirewallConf($conf) {
$ret = false; $ret = false;
if ( is_array($conf) ) { if ( is_array($conf) ) $ret = write_php_ini($conf,RASPAP_FIREWALL_CONF);
write_php_ini($conf,"/tmp/fwdata"); return $ret;
exec('sudo /bin/cp /tmp/fwdata '. RASPAP_FIREWALL_CONF,$out);
$ret = empty($out);
unlink("/tmp/fwdata");
}
return $ret
} }