header("Expires: " . gmdate("D, j M Y H:i:s", time()) . " GMT"); header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP/1.1 header("Pragma: no-cache"); // HTTP/1.0 */ require_once "guiconfig.inc"; class QueueStats { public $queuename; public $queuelength; public $pps; public $bandwidth; public $borrows; public $suspends; public $drops; } if (!file_exists("{$g['varrun_path']}/qstats.pid") || !isvalidpid("{$g['varrun_path']}/qstats.pid")) { /* Start in the background so we don't hang up the GUI */ mwexec_bg("/usr/local/sbin/qstats -p {$g['varrun_path']}/qstats.pid"); /* Give it a moment to start up */ sleep(1); } $fd = @fsockopen("unix://{$g['varrun_path']}/qstats"); if (!$fd) { $error = gettext("Something wrong happened during communication with stat gathering."); } else { $stats = ""; while (!feof($fd)) { $stats .= fread($fd, 4096); } fclose($fd); @file_put_contents("{$g['tmp_path']}/qstats", $stats);
$pkg_success_txt = sprintf(gettext('<b>%1$s</b> reinstallation successfully completed.'), $pkgname); $pkg_fail_txt = sprintf(gettext('<b>%1$s</b> reinstallation failed!'), $pkgname); $pkg_wait_txt = sprintf(gettext('Please wait while the reinstallation of <b>%1$s</b> completes.'), $pkgname); } else { $panel_heading_txt = gettext("Package Installation"); $pkg_success_txt = sprintf(gettext('<b>%1$s</b> installation successfully completed.'), $pkgname); $pkg_fail_txt = sprintf(gettext('<b>%1$s</b> installation failed!'), $pkgname); $pkg_wait_txt = sprintf(gettext('Please wait while the installation of <b>%1$s</b> completes.'), $pkgname); } } } } if ($confirmed) { // XXX: What if the user navigates away from this page and then comes back via his/her "Back" button? $pidfile = $g['varrun_path'] . '/' . $g['product_name'] . '-upgrade.pid'; if (isvalidpid($pidfile)) { $start_polling = true; } ?> <input type="hidden" name="id" value="<?php echo $_REQUEST['id']; ?> " /> <input type="hidden" name="mode" value="<?php echo $pkgmode; ?> " /> <input type="hidden" name="completed" value="true" /> <input type="hidden" name="confirmed" value="true" /> <input type="hidden" id="reboot_needed" name="reboot_needed" value="no" />
install_cron_job("/usr/bin/nice -n20 /etc/rc.update_bogons.sh", true, "1", "3", "*", "*", "*"); break; case 'weekly': install_cron_job("/usr/bin/nice -n20 /etc/rc.update_bogons.sh", true, "1", "3", "*", "*", "0"); break; case 'monthly': // fall through // fall through default: install_cron_job("/usr/bin/nice -n20 /etc/rc.update_bogons.sh", true, "1", "3", "1", "*", "*"); } $config['system']['bogons']['interval'] = $_POST['bogonsinterval']; } write_config(); // Kill filterdns when value changes, filter_configure() will restart it if ($old_aliasesresolveinterval != $config['system']['aliasesresolveinterval'] && isvalidpid("{$g['varrun_path']}/filterdns.pid")) { killbypid("{$g['varrun_path']}/filterdns.pid"); } $retval = 0; $retval = filter_configure(); if (stristr($retval, "error") != true) { $savemsg = get_std_save_message($retval); $class = 'success'; } else { $savemsg = $retval; $class = 'warning'; } } } $pgtitle = array(gettext("System"), gettext("Advanced"), htmlspecialchars(gettext("Firewall & NAT"))); include "head.inc";
/** * Wrapper for filter_configure() * * @param string $username * @param string $password * * @return bool */ public function filter_configure($username, $password) { $this->auth($username, $password); global $g, $config; filter_configure(); system_routing_configure(); setup_gateways_monitor(); relayd_configure(); require_once "openvpn.inc"; openvpn_resync_all(); /* * The DNS Resolver and the DNS Forwarder may both be active so * long as * they are running on different ports. * See ticket #5882 */ if (isset($config['dnsmasq']['enable'])) { /* Configure dnsmasq but tell it NOT to restart DHCP */ services_dnsmasq_configure(false); } else { /* kill any running dnsmasq instance */ if (isvalidpid("{$g['varrun_path']}/dnsmasq.pid")) { sigkillbypid("{$g['varrun_path']}/dnsmasq.pid", "TERM"); } } if (isset($config['unbound']['enable'])) { /* Configure unbound but tell it NOT to restart DHCP */ services_unbound_configure(false); } else { /* kill any running Unbound instance */ if (isvalidpid("{$g['varrun_path']}/unbound.pid")) { sigkillbypid("{$g['varrun_path']}/unbound.pid", "TERM"); } } /* * Call this separately since the above are manually set to * skip the DHCP restart they normally perform. * This avoids restarting dhcpd twice as described on * ticket #3797 */ services_dhcpd_configure(); local_sync_accounts(); return true; }