当前位置: 首页>>代码示例>>PHP>>正文


PHP services_dhcpd_configure函数代码示例

本文整理汇总了PHP中services_dhcpd_configure函数的典型用法代码示例。如果您正苦于以下问题:PHP services_dhcpd_configure函数的具体用法?PHP services_dhcpd_configure怎么用?PHP services_dhcpd_configure使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了services_dhcpd_configure函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: clear_all_log_files

function clear_all_log_files()
{
    killbyname('syslogd');
    $log_files = array("system", "filter", "dhcpd", "vpn", "pptps", "poes", "l2tps", "openvpn", "portalauth", "ipsec", "ppps", "relayd", "wireless", "lighttpd", "ntpd", "gateways", "resolver", "routing");
    foreach ($log_files as $lfile) {
        clear_log_file("/var/log/{$lfile}.log", false);
    }
    system_syslogd_start();
    killbyname("dhcpd");
    services_dhcpd_configure();
}
开发者ID:Toudix,项目名称:core,代码行数:11,代码来源:diag_logs_settings.php

示例2: clear_all_log_files

function clear_all_log_files()
{
    killbyname('syslogd');
    $clog_files = array('dhcpd', 'filter', 'gateways', 'ipsec', 'l2tps', 'lighttpd', 'ntpd', 'openvpn', 'poes', 'portalauth', 'ppps', 'pptps', 'relayd', 'resolver', 'routing', 'system', 'vpn', 'wireless');
    $log_files = array('squid/access', 'squid/cache', 'squid/store');
    foreach ($clog_files as $lfile) {
        clear_clog("/var/log/{$lfile}.log", false);
    }
    foreach ($log_files as $lfile) {
        clear_log("/var/log/{$lfile}.log", false);
    }
    system_syslogd_start();
    killbyname('dhcpd');
    services_dhcpd_configure();
}
开发者ID:8191,项目名称:opnsense-core,代码行数:15,代码来源:diag_logs_settings.php

示例3: dhcpv6_apply_changes

function dhcpv6_apply_changes($dhcpdv6_enable_changed)
{
    $retval = 0;
    $retvaldhcp = 0;
    $retvaldns = 0;
    /* Stop DHCPv6 so we can cleanup leases */
    killbypid("{$g['dhcpd_chroot_path']}{$g['varrun_path']}/dhcpdv6.pid");
    // dhcp_clean_leases();
    /* 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');
                clear_subsystem_dirty('staticmaps');
            }
        } else {
            $retvaldhcp = services_dhcpd_configure();
            if ($retvaldhcp == 0) {
                clear_subsystem_dirty('staticmaps');
            }
        }
    }
    if ($dhcpdv6_enable_changed) {
        $retvalfc = filter_configure();
    }
    if ($retvaldhcp == 1 || $retvaldns == 1 || $retvalfc == 1) {
        $retval = 1;
    }
    return get_std_save_message($retval);
}
开发者ID:NewEraCracker,项目名称:pfsense,代码行数:38,代码来源:services_dhcpv6.php

示例4: unset

 unset($input_errors);
 if (!is_subsystem_dirty('interfaces')) {
     $input_errors[] = gettext("You have already applied your settings!");
 } else {
     unlink_if_exists("{$g['tmp_path']}/config.cache");
     clear_subsystem_dirty('interfaces');
     if (file_exists("{$g['tmp_path']}/.interfaces.apply")) {
         $toapplylist = unserialize(file_get_contents("{$g['tmp_path']}/.interfaces.apply"));
         foreach ($toapplylist as $ifapply => $ifcfgo) {
             if (isset($config['interfaces'][$ifapply]['enable'])) {
                 interface_bring_down($ifapply, false, $ifcfgo);
                 interface_configure($ifapply, true);
             } else {
                 interface_bring_down($ifapply, true, $ifcfgo);
                 if (isset($config['dhcpd'][$ifapply]['enable']) || isset($config['dhcpdv6'][$ifapply]['enable'])) {
                     services_dhcpd_configure();
                 }
             }
         }
     }
     /* restart snmp so that it binds to correct address */
     services_snmpd_configure();
     /* sync filter configuration */
     setup_gateways_monitor();
     clear_subsystem_dirty('interfaces');
     filter_configure();
     enable_rrd_graphing();
     if (is_subsystem_dirty('staticroutes') && system_routing_configure() == 0) {
         clear_subsystem_dirty('staticroutes');
     }
 }
开发者ID:simudream,项目名称:pfsense,代码行数:31,代码来源:interfaces.php

示例5: services_dnsmasq_configure

    /* 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 {
            $retvaldhcp = services_dhcpd_configure();
            if ($retvaldhcp == 0) {
                clear_subsystem_dirty('staticmaps');
            }
        }
    }
    if ($dhcpd_enable_changed) {
        $retvalfc = filter_configure();
    }
    if ($retvaldhcp == 1 || $retvaldns == 1 || $retvalfc == 1) {
        $retval = 1;
    }
    $savemsg = get_std_save_message();
}
if ($act == "delpool") {
    if ($a_pools[$_GET['id']]) {
开发者ID:karawan,项目名称:core,代码行数:31,代码来源:services_dhcp.php

示例6: service_control_restart

function service_control_restart($name, $extras)
{
    switch ($name) {
        case 'radvd':
            services_radvd_configure();
            break;
        case 'ntpd':
            system_ntp_configure();
            break;
        case 'apinger':
            killbypid("/var/run/apinger.pid");
            setup_gateways_monitor();
            break;
        case 'bsnmpd':
            services_snmpd_configure();
            break;
        case 'dhcrelay':
            services_dhcrelay_configure();
            break;
        case 'dhcrelay6':
            services_dhcrelay6_configure();
            break;
        case 'dnsmasq':
            services_dnsmasq_configure();
            break;
        case 'unbound':
            services_unbound_configure();
            break;
        case 'dhcpd':
            services_dhcpd_configure();
            break;
        case 'igmpproxy':
            services_igmpproxy_configure();
            break;
        case 'miniupnpd':
            upnp_action('restart');
            break;
        case 'ipsec':
            vpn_ipsec_force_reload();
            break;
        case 'sshd':
            configd_run("sshd restart");
            break;
        case 'openvpn':
            $vpnmode = htmlspecialchars($extras['vpnmode']);
            if ($vpnmode == "server" || $vpnmode == "client") {
                $id = htmlspecialchars($extras['id']);
                $configfile = "/var/etc/openvpn/{$vpnmode}{$id}.conf";
                if (file_exists($configfile)) {
                    openvpn_restart_by_vpnid($vpnmode, $id);
                }
            }
            break;
        case 'relayd':
            relayd_configure(true);
            break;
        case 'squid':
            configd_run("proxy restart");
            break;
        case 'suricata':
            configd_run("ids restart");
            break;
        default:
            log_error(sprintf(gettext("Could not restart unknown service `%s'"), $name));
            break;
    }
    return sprintf(gettext("%s has been restarted."), htmlspecialchars($name));
}
开发者ID:8191,项目名称:opnsense-core,代码行数:68,代码来源:status_services.php

示例7: clear_hook

function clear_hook()
{
    killbyname('dhcpd');
    services_dhcpd_configure();
}
开发者ID:paudam,项目名称:opnsense-core,代码行数:5,代码来源:diag_logs_dhcp.php

示例8: filter_configure_xmlrpc

function filter_configure_xmlrpc($raw_params)
{
    global $xmlrpc_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();
    if (isset($config['dnsmasq']['enable'])) {
        services_dnsmasq_configure();
    } elseif (isset($config['unbound']['enable'])) {
        services_unbound_configure();
    } else {
        # Both calls above run services_dhcpd_configure(), then we just
        # need to call it when they are not called to avoid restarting dhcpd
        # twice, as described on ticket #3797
        services_dhcpd_configure();
    }
    local_sync_accounts();
    return $xmlrpc_g['return']['true'];
}
开发者ID:michaeleino,项目名称:pfsense,代码行数:27,代码来源:xmlrpc.php

示例9: filter_configure

 /**
  * 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;
 }
开发者ID:KyleJohnstonNet,项目名称:pfsense,代码行数:51,代码来源:xmlrpc.php

示例10: gettext

 if (link_interface_to_gif($id)) {
     $input_errors[] = gettext("The interface is part of a gif tunnel. Please delete the tunnel to continue");
 } else {
     unset($config['interfaces'][$id]['enable']);
     $realid = get_real_interface($id);
     interface_bring_down($id);
     /* down the interface */
     unset($config['interfaces'][$id]);
     /* delete the specified OPTn or LAN*/
     if (is_array($config['dhcpd']) && is_array($config['dhcpd'][$id])) {
         unset($config['dhcpd'][$id]);
         services_dhcpd_configure('inet');
     }
     if (is_array($config['dhcpdv6']) && is_array($config['dhcpdv6'][$id])) {
         unset($config['dhcpdv6'][$id]);
         services_dhcpd_configure('inet6');
     }
     if (count($config['filter']['rule']) > 0) {
         foreach ($config['filter']['rule'] as $x => $rule) {
             if ($rule['interface'] == $id) {
                 unset($config['filter']['rule'][$x]);
             }
         }
     }
     if (is_array($config['nat']['rule']) && count($config['nat']['rule']) > 0) {
         foreach ($config['nat']['rule'] as $x => $rule) {
             if ($rule['interface'] == $id) {
                 unset($config['nat']['rule'][$x]['interface']);
             }
         }
     }
开发者ID:NewEraCracker,项目名称:pfsense,代码行数:31,代码来源:interfaces_assign.php

示例11: filter_configure_xmlrpc

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'];
}
开发者ID:curtiszimmerman,项目名称:pfsense,代码行数:43,代码来源:xmlrpc.php

示例12: filter_configure_xmlrpc

function filter_configure_xmlrpc($raw_params)
{
    global $xmlrpc_g;
    $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();
    services_dhcpd_configure();
    services_dnsmasq_configure();
    local_sync_accounts();
    return $xmlrpc_g['return']['true'];
}
开发者ID:rdmenezes,项目名称:pfsense,代码行数:19,代码来源:xmlrpc.php


注:本文中的services_dhcpd_configure函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。