本文整理汇总了PHP中configd_run函数的典型用法代码示例。如果您正苦于以下问题:PHP configd_run函数的具体用法?PHP configd_run怎么用?PHP configd_run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了configd_run函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: killbyname
<script type="text/javascript">
//<![CDATA[
prot_change();
//]]>
</script>
<?php
if ($restart_webgui) {
echo "<meta http-equiv=\"refresh\" content=\"20;url={$url}\" />";
}
?>
<?php
include "foot.inc";
?>
<?php
if ($restart_sshd) {
killbyname("sshd");
log_error(gettext("secure shell configuration has changed. Stopping sshd."));
if ($config['system']['ssh']['enabled']) {
log_error(gettext("secure shell configuration has changed. Restarting sshd."));
configd_run("sshd restart");
}
}
if ($restart_webgui) {
ob_flush();
flush();
log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator."));
mwexec_bg('/usr/local/etc/rc.restart_webgui 2');
}
示例2: write_config
}
}
write_config();
system_hostname_configure();
system_hosts_generate();
system_resolvconf_generate();
if (isset($config['dnsmasq']['enable'])) {
services_dnsmasq_configure();
} elseif (isset($config['unbound']['enable'])) {
services_unbound_configure();
}
system_timezone_configure();
system_firmware_configure();
system_ntp_configure();
if ($olddnsallowoverride != $config['system']['dnsallowoverride']) {
configd_run("dns reload");
}
// Reload the filter - plugins might need to be run.
filter_configure();
$savemsg = get_std_save_message();
}
unset($ignore_posted_dnsgw);
}
legacy_html_escape_form_data($pconfig);
include "head.inc";
?>
<body>
<?php
include "fbegin.inc";
?>
示例3: escapeshellarg
$delTable = escapeshellarg($tablename);
configd_run("filter delete table {$delTable} {$delEntry}");
header("Location: diag_tables.php?tablename=" . $tablename);
exit;
}
} elseif (isset($_POST['act']) && $_POST['act'] == 'flush') {
$delTable = escapeshellarg($tablename);
configd_run("filter delete table {$delTable} ALL");
header("Location: diag_tables.php?tablename=" . $tablename);
exit;
}
}
// fetch list of tables and content of selected table
$tables = json_decode(configd_run("filter list tables json"));
if (in_array($tablename, $tables)) {
$entries = json_decode(configd_run("filter list table {$tablename} json"));
} else {
$entries = array();
}
include "head.inc";
?>
<body>
<?php
include "fbegin.inc";
?>
<script type="text/javascript">
$( document ).ready(function() {
// on change pfTable selection
$("#tablename").change(function(){
示例4: filter_configure
filter_configure();
$savemsg = get_std_save_message();
if ($restart_webgui) {
$savemsg .= sprintf("<br />" . gettext("One moment...redirecting to %s in 20 seconds."), $url);
}
setup_serial_port();
system_hosts_generate();
// Restart DNS in case dns rebinding toggled
if (isset($config['dnsmasq']['enable'])) {
services_dnsmasq_configure();
} elseif (isset($config['unbound']['enable'])) {
services_unbound_configure();
}
if ($restart_sshd) {
log_error(gettext('Secure Shell configuration has changed. Applying now...'));
configd_run('sshd restart', true);
}
if ($restart_webgui) {
log_error(gettext('webConfigurator configuration has changed. Applying now...'));
mwexec_bg('/usr/local/etc/rc.restart_webgui 2');
}
}
}
$a_cert = isset($config['cert']) ? $config['cert'] : array();
$certs_available = false;
if (count($a_cert)) {
$certs_available = true;
}
if (empty($pconfig['webguiproto']) || !$certs_available) {
$pconfig['webguiproto'] = "http";
}
示例5: configd_run
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// fetch only valid input data (items from above lists)
$viewtype = 'default';
$numstate = '200';
$sorttype = 'bytes';
if (isset($_POST['viewtype']) && in_array($_POST['viewtype'], $viewtypes)) {
$viewtype = $_POST['viewtype'];
}
if (isset($_POST['states']) && in_array($_POST['states'], $numstates)) {
$numstate = $_POST['states'];
}
if (isset($_POST['sorttype']) && in_array($_POST['sorttype'], $sorttypes)) {
$sorttype = $_POST['sorttype'];
}
// fetch pftop data
echo configd_run("filter diag top {$sorttype} {$viewtype} {$numstate}");
exit;
}
include "head.inc";
?>
<body>
<?php
include "fbegin.inc";
?>
<script type="text/javascript">
$( document ).ready(function() {
/**
* fetch pftop data from backend
*/
function getpftopactivity() {
$.ajax(
示例6: DAMAGES
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 "pfsense-utils.inc";
require_once "interfaces.inc";
/* TCP flags */
$tcpflags = array("syn", "ack", "fin", "rst", "psh", "urg", "ece", "cwr");
/* OS types, request from backend */
$ostypes = json_decode(configd_run('filter list osfp json'));
/**
* build array with interface options for this form
*/
function formInterfaces()
{
global $config;
$interfaces = array();
foreach (get_configured_interface_with_descr(false, true) as $if => $ifdesc) {
$interfaces[$if] = $ifdesc;
}
if (!empty($config['ifgroups']['ifgroupentry']) && is_array($config['ifgroups']['ifgroupentry'])) {
foreach ($config['ifgroups']['ifgroupentry'] as $ifgrp) {
$interfaces[$ifgrp['ifname']] = $ifgrp['descr'];
}
}
示例7: killbyname
<script type="text/javascript">
//<![CDATA[
prot_change();
//]]>
</script>
<?php
if ($restart_webgui) {
echo "<meta http-equiv=\"refresh\" content=\"20;url={$url}\" />";
}
?>
<?php
include "foot.inc";
?>
<?php
if ($restart_sshd) {
killbyname("sshd");
log_error(gettext("secure shell configuration has changed. Stopping sshd."));
if ($config['system']['ssh']['enabled']) {
log_error(gettext("secure shell configuration has changed. Restarting sshd."));
configd_run("sshd restart");
}
}
if ($restart_webgui) {
ob_flush();
flush();
log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator."));
configd_run("webgui restart 2", true);
}
示例8: configd_run
}
if ($_GET['getstatus']) {
echo "|{$status}|";
exit;
}
if ($_POST['reloadfilter']) {
configd_run("filter reload");
if (isset($config['hasync']['synchronizetoip']) && trim($config['hasync']['synchronizetoip']) != "") {
// only try to sync when hasync is configured
configd_run("filter sync reload");
}
header("Location: status_filter_reload.php");
exit;
}
if ($_POST['syncfilter']) {
configd_run("filter sync");
header("Location: status_filter_reload.php");
exit;
}
include "head.inc";
?>
<body>
<?php
include "fbegin.inc";
?>
<section class="page-content-main">
<div class="container-fluid">
<div class="row">
示例9: unset
if ($rule['gateway'] == $a_gateway_groups[$_POST['id']]['name']) {
unset($config['filter']['rule'][$idx]['gateway']);
}
}
unset($a_gateway_groups[$_POST['id']]);
write_config();
mark_subsystem_dirty('staticroutes');
header("Location: system_gateway_groups.php");
exit;
}
} elseif (isset($_POST['apply'])) {
$retval = 0;
$retval = system_routing_configure();
configd_run('dyndns reload');
configd_run('ipsecdns reload');
configd_run('filter reload');
/* reconfigure our gateway monitor */
setup_gateways_monitor();
if ($retval == 0) {
clear_subsystem_dirty('staticroutes');
}
foreach ($a_gateway_groups as $gateway_group) {
$gw_subsystem = 'gwgroup.' . $gateway_group['name'];
if (is_subsystem_dirty($gw_subsystem)) {
openvpn_resync_gwgroup($gateway_group['name']);
clear_subsystem_dirty($gw_subsystem);
}
}
header("Location: system_gateway_groups.php");
exit;
}
示例10: update_alias_names_upon_change
update_alias_names_upon_change(array('aliases', 'alias'), array('address'), $pconfig['name'], $origname);
}
// save to config
if (isset($id)) {
$a_aliases[$id] = $confItem;
} else {
$a_aliases[] = $confItem;
}
// Sort list
$a_aliases = msort($a_aliases, "name");
if (write_config()) {
// post save actions
mark_subsystem_dirty('aliases');
if (strpos($pconfig['type'], 'url') !== false) {
// update URL Table Aliases
configd_run('filter refresh_url_alias', true);
}
}
if ($pconfig['type'] == 'host') {
header("Location: firewall_aliases.php?tab=ip");
} elseif (strpos($pconfig['type'], 'url') !== false) {
header("Location: firewall_aliases.php?tab=url");
} else {
header("Location: firewall_aliases.php?tab=" . $pconfig['type']);
}
exit;
}
}
}
$referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_aliases.php';
legacy_html_escape_form_data($pconfig);
示例11: 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";
include_once "includes/functions.inc.php";
require_once "pfsense-utils.inc";
require_once "system.inc";
if (isset($_REQUEST['getupdatestatus'])) {
$pkg_json = trim(configd_run('firmware pkgstatus'));
if ($pkg_json != '') {
$pkg_status = json_decode($pkg_json, true);
}
if (!isset($pkg_status) || $pkg_status["connection"] == "error") {
echo "<span class='text-danger'>" . gettext("Connection Error") . "</span><br/><span class='btn-link' onclick='checkupdate()'>" . gettext("Click to retry") . "</span>";
} elseif ($pkg_status["repository"] == "error") {
echo "<span class='text-danger'>" . gettext("Repository Problem") . "</span><br/><span class='btn-link' onclick='checkupdate()'>" . gettext("Click to retry") . "</span>";
} elseif ($pkg_status["updates"] == "0") {
echo "<span class='text-info'>" . gettext("Your system is up to date.") . "</span><br/><span class='btn-link' onclick='checkupdate()'>" . gettext('Click to check for updates') . "</span>";
} else {
echo "<span class='text-info'>" . gettext("There are ") . $pkg_status["updates"] . gettext(" update(s) available.") . "</span><br/><a href='/ui/core/firmware/#checkupdate'>" . gettext("Click to upgrade") . "</a> | <span class='btn-link' onclick='checkupdate()'>" . gettext('Re-check now') . "</span>";
}
exit;
}
$filesystems = get_mounted_filesystems();
示例12: 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 "pfsense-utils.inc";
require_once "system.inc";
require_once "stats.inc";
if (isset($_REQUEST['getupdatestatus'])) {
$pkg_json = trim(configd_run('firmware check'));
if ($pkg_json != '') {
$pkg_status = json_decode($pkg_json, true);
}
if (!isset($pkg_status) || $pkg_status["connection"] == "error") {
echo "<span class='text-danger'>" . gettext("Connection Error") . "</span><br/><span class='btn-link' onclick='checkupdate()'>" . gettext("Click to retry") . "</span>";
} elseif ($pkg_status["repository"] == "error") {
echo "<span class='text-danger'>" . gettext("Repository Problem") . "</span><br/><span class='btn-link' onclick='checkupdate()'>" . gettext("Click to retry") . "</span>";
} elseif ($pkg_status["updates"] == "0") {
echo "<span class='text-info'>" . gettext("Your system is up to date.") . "</span><br/><span class='btn-link' onclick='checkupdate()'>" . gettext('Click to check for updates') . "</span>";
} else {
echo "<span class='text-info'>" . gettext("There are ") . $pkg_status["updates"] . gettext(" update(s) available.") . "</span><br/><a href='/ui/core/firmware/#checkupdate'>" . gettext("Click to upgrade") . "</a> | <span class='btn-link' onclick='checkupdate()'>" . gettext('Re-check now') . "</span>";
}
exit;
}
$filesystems = get_mounted_filesystems();
示例13: DAMAGES
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 "vpn.inc";
require_once "services.inc";
require_once "interfaces.inc";
$shortcut_section = 'ipsec';
include "head.inc";
$ipsec_leases = json_decode(configd_run("ipsec list leases"), true);
?>
<body>
<?php
include "fbegin.inc";
?>
<section class="page-content-main">
<div class="container-fluid">
<div class="row">
<section class="col-xs-12">
<div class="content-box">
<?php
if (count($ipsec_leases) > 0) {
foreach ($ipsec_leases as $pool => $pool_data) {
?>
示例14: foreach
foreach (array_reverse($portarr, TRUE) as $port => $count) {
$str = "";
$service = getservbyport($port, strtolower($proto));
$port = "{$proto}/{$port}";
if (!empty($service)) {
$port = "{$port} ({$service})";
}
$ports[] = "{$port}: {$count}";
}
return implode($ports, ', ');
}
$srcipinfo = array();
$dstipinfo = array();
$allipinfo = array();
$pairipinfo = array();
$states = json_decode(configd_run("filter list states json"), true);
if (isset($states['details'])) {
foreach ($states['details'] as $state) {
if (isset($state['nat_addr']) && $states['direction'] == 'out') {
$srcip = $state['nat_addr'];
$srcport = $state['nat_port'];
} else {
$srcip = $state['src_addr'];
$srcport = $state['src_port'];
}
$dstip = $state['dst_addr'];
$dstport = $state['dst_port'];
$proto = $state['proto'];
addipinfo($srcipinfo, $srcip, $proto, $srcport, $dstport);
addipinfo($dstipinfo, $dstip, $proto, $srcport, $dstport);
addipinfo($pairipinfo, "{$srcip} -> {$dstip}", $proto, $srcport, $dstport);
示例15: unset
} else {
unset($gateway['disabled']);
}
/* when saving the manual gateway we use the attribute which has the corresponding id */
if (isset($realid)) {
$a_gateway_item[$realid] = $gateway;
} else {
$a_gateway_item[] = $gateway;
}
mark_subsystem_dirty('staticroutes');
write_config();
if (!empty($_REQUEST['isAjax'])) {
echo $pconfig['name'];
exit;
} elseif (!empty($reloadif)) {
configd_run("interface reconfigure {$reloadif}");
}
header("Location: system_gateways.php");
exit;
} else {
if (!empty($_REQUEST['isAjax'])) {
header("HTTP/1.0 500 Internal Server Error");
header("Content-type: text/plain");
foreach ($input_errors as $error) {
echo "{$error}\n";
}
exit;
}
if (!empty($pconfig['interface'])) {
$pconfig['friendlyiface'] = $_POST['interface'];
}