本文整理汇总了PHP中interface_bring_down函数的典型用法代码示例。如果您正苦于以下问题:PHP interface_bring_down函数的具体用法?PHP interface_bring_down怎么用?PHP interface_bring_down使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了interface_bring_down函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unset
}
if ($_POST['apply']) {
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');
示例2: DAMAGES
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
require_once "guiconfig.inc";
require_once "filter.inc";
if ($_POST['if'] && $_POST['submit']) {
$interface = $_POST['if'];
if ($_POST['status'] == "up") {
interface_bring_down($interface);
} else {
interface_configure($interface);
}
header("Location: status_interfaces.php");
exit;
}
$pgtitle = array(gettext("Status"), gettext("Interfaces"));
$shortcut_section = "interfaces";
include "head.inc";
?>
<body>
<?php
include "fbegin.inc";
?>
示例3: gettext
$id = $delbtn;
if (link_interface_to_group($id)) {
$input_errors[] = gettext("The interface is part of a group. Please remove it from the group to continue");
} else {
if (link_interface_to_bridge($id)) {
$input_errors[] = gettext("The interface is part of a bridge. Please remove it from the bridge to continue");
} else {
if (link_interface_to_gre($id)) {
$input_errors[] = gettext("The interface is part of a gre tunnel. Please delete the tunnel to continue");
} else {
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();
}
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) {
示例4: foreach
}
if (isset($config['vlans']['vlan'])) {
foreach ($config['vlans']['vlan'] as $vlan) {
if (!does_interface_exist($vlan['if'])) {
$input_errors[] = sprintf(gettext("VLAN parent interface %s does not exist."), $vlan['if']);
}
}
}
if (count($input_errors) == 0) {
/* No errors detected, so update the config */
$changes = 0;
foreach ($_POST as $ifname => $ifport) {
if (!is_array($ifport) && ($ifname == 'lan' || $ifname == 'wan' || substr($ifname, 0, 3) == 'opt')) {
$reloadif = false;
if (!empty($config['interfaces'][$ifname]['if']) && $config['interfaces'][$ifname]['if'] != $ifport) {
interface_bring_down($ifname);
/* Mark this to be reconfigured in any case. */
$reloadif = true;
}
$config['interfaces'][$ifname]['if'] = $ifport;
if ($interfaces[$ifport]['section'] == 'ppps.ppp') {
$config['interfaces'][$ifname]['ipaddr'] = $interfaces[$ifport]['type'];
}
if (substr($ifport, 0, 3) == 'gre' || substr($ifport, 0, 3) == 'gif') {
unset($config['interfaces'][$ifname]['ipaddr']);
unset($config['interfaces'][$ifname]['subnet']);
unset($config['interfaces'][$ifname]['ipaddrv6']);
unset($config['interfaces'][$ifname]['subnetv6']);
}
/* check for wireless interfaces, set or clear ['wireless'] */
if (match_wireless_interface($ifport)) {
示例5: foreach
}
if (isset($config['vlans']['vlan'])) {
foreach ($config['vlans']['vlan'] as $vlan) {
if (!does_interface_exist($vlan['if'])) {
$input_errors[] = sprintf(gettext("VLAN parent interface %s does not exist."), $vlan['if']);
}
}
}
if (count($input_errors) == 0) {
/* No errors detected, so update the config */
$changes = 0;
foreach ($_POST as $ifname => $ifport) {
if (!is_array($ifport) && ($ifname == 'lan' || $ifname == 'wan' || substr($ifname, 0, 3) == 'opt')) {
$reloadif = false;
if (!empty($config['interfaces'][$ifname]['if']) && $config['interfaces'][$ifname]['if'] != $ifport) {
interface_bring_down($ifname, true);
/* Mark this to be reconfigured in any case. */
$reloadif = true;
}
$config['interfaces'][$ifname]['if'] = $ifport;
if ($interfaces[$ifport]['section'] == 'ppps.ppp') {
$config['interfaces'][$ifname]['ipaddr'] = $interfaces[$ifport]['type'];
}
if (substr($ifport, 0, 3) == 'gre' || substr($ifport, 0, 3) == 'gif') {
unset($config['interfaces'][$ifname]['ipaddr']);
unset($config['interfaces'][$ifname]['subnet']);
unset($config['interfaces'][$ifname]['ipaddrv6']);
unset($config['interfaces'][$ifname]['subnetv6']);
}
/* check for wireless interfaces, set or clear ['wireless'] */
if (match_wireless_interface($ifport)) {
示例6: unset
$pconfig['mtu'] = $wancfg['mtu'];
$pconfig['mss'] = $wancfg['mss'];
if ($_POST['apply']) {
unset($input_errors);
if (!is_subsystem_dirty('interfaces')) {
$intput_errors[] = "Değişiklikleri zaten uyguladınız.";
} 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) {
if (isset($config['interfaces'][$ifapply]['enable'])) {
interface_reconfigure($ifapply, true);
} else {
interface_bring_down($ifapply);
}
}
}
/* sync filter configuration */
setup_gateways_monitor();
clear_subsystem_dirty('staticroutes');
filter_configure();
}
@unlink("{$g['tmp_path']}/.interfaces.apply");
header("Location: interfaces.php?if={$if}");
exit;
} else {
if ($_POST && $_POST['enable'] != "yes") {
unset($wancfg['enable']);
write_config();