Example #1
0
        } elseif ($act == "newpool") {
            $a_pools[] = $dhcpdconf;
        } else {
            $config['dhcpd'][$if] = $dhcpdconf;
        }
        write_config();
    }
}
if (isset($_POST['submit']) || isset($_POST['apply'])) {
    $retval = 0;
    $retvaldhcp = 0;
    $retvaldns = 0;
    /* Stop DHCP so we can cleanup leases */
    killbyname("dhcpd");
    dhcp_clean_leases();
    system_hosts_generate();
    /* dnsmasq_configure calls dhcpd_configure */
    /* no need to restart dhcpd twice */
    if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic'])) {
        $retvaldns = services_dnsmasq_configure();
        if ($retvaldns == 0) {
            clear_subsystem_dirty('hosts');
            clear_subsystem_dirty('staticmaps');
        }
    } else {
        if (isset($config['unbound']['enable']) && isset($config['unbound']['regdhcpstatic'])) {
            $retvaldns = services_unbound_configure();
            if ($retvaldns == 0) {
                clear_subsystem_dirty('unbound');
            }
        } else {
Example #2
0
             // Remove the route. Later calls will add the correct new route if needed.
             if (is_ipaddrv4($olddnsservers[$dnscounter - 1])) {
                 mwexec("/sbin/route delete " . escapeshellarg($olddnsservers[$dnscounter - 1]));
             } else {
                 if (is_ipaddrv6($olddnsservers[$dnscounter - 1])) {
                     mwexec("/sbin/route delete -inet6 " . escapeshellarg($olddnsservers[$dnscounter - 1]));
                 }
             }
         }
     }
     if ($changecount > 0) {
         write_config($changedesc);
     }
     $retval = 0;
     $retval = system_hostname_configure();
     $retval |= system_hosts_generate();
     $retval |= system_resolvconf_generate();
     if (isset($config['dnsmasq']['enable'])) {
         $retval |= services_dnsmasq_configure();
     } elseif (isset($config['unbound']['enable'])) {
         $retval |= services_unbound_configure();
     }
     $retval |= system_timezone_configure();
     $retval |= system_ntp_configure();
     if ($olddnsallowoverride != $config['system']['dnsallowoverride']) {
         $retval |= send_event("service reload dns");
     }
     // Reload the filter - plugins might need to be run.
     $retval |= filter_configure();
     $savemsg = get_std_save_message($retval);
 }