本文整理汇总了PHP中setup_serial_port函数的典型用法代码示例。如果您正苦于以下问题:PHP setup_serial_port函数的具体用法?PHP setup_serial_port怎么用?PHP setup_serial_port使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setup_serial_port函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: write_config
$prot = $config['system']['webgui']['protocol'];
$port = $config['system']['webgui']['port'];
if ($port) {
$url = "{$prot}://{$host}:{$port}/system_advanced_admin.php";
} else {
$url = "{$prot}://{$host}/system_advanced_admin.php";
}
}
write_config();
$retval = filter_configure();
$savemsg = get_std_save_message($retval);
if ($restart_webgui) {
$savemsg .= sprintf("<br />" . gettext("One moment...redirecting to %s in 20 seconds."), $url);
}
conf_mount_rw();
setup_serial_port();
// Restart DNS in case dns rebinding toggled
if (isset($config['dnsmasq']['enable'])) {
services_dnsmasq_configure();
} elseif (isset($config['unbound']['enable'])) {
services_unbound_configure();
}
conf_mount_ro();
}
}
$pgtitle = array(gettext("System"), gettext("Advanced"), gettext("Admin Access"));
include "head.inc";
if ($input_errors) {
print_input_errors($input_errors);
}
if ($savemsg) {
示例2: exec
#!/usr/local/bin/php -f
<?php
/* upgrade embedded users serial console */
require_once "globals.inc";
require_once "config.inc";
require_once "functions.inc";
if (file_exists("/usr/local/bin/git") && isset($config['system']['gitsync']['synconupgrade'])) {
if (!empty($config['system']['gitsync']['repositoryurl'])) {
exec("cd /root/pfsense/pfSenseGITREPO/pfSenseGITREPO && git config remote.origin.url " . escapeshellarg($config['system']['gitsync']['repositoryurl']));
}
if (!empty($config['system']['gitsync']['branch'])) {
system("pfSsh.php playback gitsync " . escapeshellarg($config['system']['gitsync']['branch']) . " --upgrading");
}
}
$newslicedir = "";
if (isset($argv[1]) && $argv[1] != "") {
$newslicedir = '/tmp/' . $argv[1];
}
if ($g['enableserial_force'] || file_exists("{$newslicedir}/enableserial_force")) {
$config['system']['enableserial'] = true;
write_config();
}
system("echo \"Adding serial port settings ({$newslicedir})...\" >> /conf/upgrade_log.txt");
setup_serial_port("upgrade", $newslicedir);