Example #1
0
 /**
  * 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;
 }
Example #2
0
            unset($wancfg['blockbogons']);
        }
        $wancfg['spoofmac'] = $_POST['spoofmac'];
        $wancfg['mtu'] = $_POST['mtu'];
        write_config();
        /* finally install the pppoerestart file */
        if (isset($_POST['pppoe_preset'])) {
            config_lock();
            conf_mount_rw();
            if (!file_exists(CRON_PPPOE_CMD_FILE)) {
                file_put_contents(CRON_PPPOE_CMD_FILE, CRON_PPPOE_CMD);
                chmod(CRON_PPPOE_CMD_FILE, 0700);
            }
            /* regenerate cron settings/crontab file */
            configure_cron();
            sigkillbypid("{$g['varrun_path']}/cron.pid", "HUP");
            conf_mount_ro();
            config_unlock();
        }
        $retval = 0;
        $savemsg = get_std_save_message($retval);
    }
}
$pgtitle = "Interfaces: WAN";
$closehead = false;
include "head.inc";
?>

<script type="text/javascript" src="/javascript/numericupdown/js/numericupdown.js"></script>
<link href="/javascript/numericupdown/css/numericupdown.css" rel="stylesheet" type="text/css" />
Example #3
0
function filter_configure_xmlrpc($raw_params)
{
    global $xmlrpc_g, $g, $config;
    $params = xmlrpc_params_to_php($raw_params);
    if (!xmlrpc_auth($params)) {
        xmlrpc_authfail();
        return $xmlrpc_g['return']['authfail'];
    }
    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
     */
    $need_dhcp_start = true;
    if (isset($config['dnsmasq']['enable'])) {
        /* Configure dnsmasq but tell it NOT to restart DHCP */
        services_dnsmasq_configure(false);
    } else {
        /* kill any running dnsmasq since it is not enabled. */
        if (file_exists("{$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 since it is not enabled. */
        if (file_exists("{$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 $xmlrpc_g['return']['true'];
}