當前位置: 首頁>>代碼示例>>PHP>>正文


PHP set_single_sysctl函數代碼示例

本文整理匯總了PHP中set_single_sysctl函數的典型用法代碼示例。如果您正苦於以下問題:PHP set_single_sysctl函數的具體用法?PHP set_single_sysctl怎麽用?PHP set_single_sysctl使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了set_single_sysctl函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: sprintf

                        break;
                }
            }
            $savemsg = sprintf(gettext("%s IPs have been disabled. Please note that disabling does not survive a reboot."), $carp_counter);
        } else {
            $savemsg = gettext("CARP has been enabled.");
            foreach ($a_vip as $vip) {
                switch ($vip['mode']) {
                    case "carp":
                        interface_carp_configure($vip);
                        sleep(1);
                        break;
                }
            }
            interfaces_carp_setup();
            set_single_sysctl('net.inet.carp.allow', '1');
        }
    }
}
$carpcount = 0;
foreach ($a_vip as $carp) {
    if ($carp['mode'] == "carp") {
        $carpcount++;
        break;
    }
}
// fetch pfsync info
$pfsyncnodes = json_decode(configd_run("filter list pfsync json"), true);
legacy_html_escape_form_data($a_vip);
$status = get_single_sysctl('net.inet.carp.allow') > 0;
$carp_detected_problems = array_pop(get_sysctl("net.inet.carp.demotion")) > 0;
開發者ID:8191,項目名稱:opnsense-core,代碼行數:31,代碼來源:carp_status.php

示例2: interface_proxyarp_configure

                            interface_proxyarp_configure($a_vip[$vid]['interface']);
                            break;
                        case "carp":
                            $check_carp = true;
                            interface_carp_configure($a_vip[$vid]);
                            break;
                        default:
                            break;
                    }
                }
            }
            @unlink("{$g['tmp_path']}/.firewall_virtual_ip.apply");
        }
        /* Before changing check #4633 */
        if ($check_carp === true && !get_carp_status()) {
            set_single_sysctl("net.inet.carp.allow", "1");
        }
        $retval = 0;
        $retval |= filter_configure();
        $savemsg = get_std_save_message($retval);
        clear_subsystem_dirty('vip');
    }
}
if ($_GET['act'] == "del") {
    if ($a_vip[$_GET['id']]) {
        /* make sure no inbound NAT mappings reference this entry */
        if (is_array($config['nat']['rule'])) {
            foreach ($config['nat']['rule'] as $rule) {
                if ($rule['destination']['address'] != "") {
                    if ($rule['destination']['address'] == $a_vip[$_GET['id']]['subnet']) {
                        $input_errors[] = gettext("This entry cannot be deleted because it is still referenced by at least one NAT mapping.");
開發者ID:geijt,項目名稱:pfsense,代碼行數:31,代碼來源:firewall_virtual_ip.php

示例3: interface_ipalias_configure

                    case 'ipalias':
                        if (substr($vip['interface'], 0, 4) == "_vip") {
                            interface_ipalias_configure($vip);
                        }
                        break;
                }
            }
        }
        interfaces_sync_setup();
        set_single_sysctl('net.inet.carp.allow', '1');
        $status = 1;
    }
}
$carp_detected_problems = get_single_sysctl("net.inet.carp.demotion");
if (!empty($_POST['resetdemotion'])) {
    set_single_sysctl("net.inet.carp.demotion", "-{$carp_detected_problems}");
    sleep(1);
    $carp_detected_problems = get_single_sysctl("net.inet.carp.demotion");
}
$pgtitle = array(gettext("Status"), gettext("CARP"));
$shortcut_section = "carp";
include "head.inc";
if ($savemsg) {
    print_info_box($savemsg, 'success');
}
$carpcount = 0;
if (is_array($config['virtualip']['vip'])) {
    foreach ($config['virtualip']['vip'] as $carp) {
        if ($carp['mode'] == "carp") {
            $carpcount++;
            break;
開發者ID:nwholloway,項目名稱:pfsense,代碼行數:31,代碼來源:status_carp.php


注:本文中的set_single_sysctl函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。