本文整理匯總了PHP中rc_exec_service函數的典型用法代碼示例。如果您正苦於以下問題:PHP rc_exec_service函數的具體用法?PHP rc_exec_service怎麽用?PHP rc_exec_service使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了rc_exec_service函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: gmirror_process_updatenotification
function gmirror_process_updatenotification($mode, $data)
{
global $config;
$retval = 0;
switch ($mode) {
case UPDATENOTIFY_MODE_NEW:
$retval |= rc_exec_service("geom load mirror");
$retval |= disks_raid_gmirror_configure($data);
break;
case UPDATENOTIFY_MODE_MODIFIED:
$retval |= rc_exec_service("geom start mirror");
break;
case UPDATENOTIFY_MODE_DIRTY:
$retval |= disks_raid_gmirror_delete($data);
if (is_array($config['gmirror']['vdisk'])) {
$index = array_search_ex($data, $config['gmirror']['vdisk'], "uuid");
if (false !== $index) {
unset($config['gmirror']['vdisk'][$index]);
write_config();
}
}
break;
}
return $retval;
}
示例2: routes_process_updatenotification
function routes_process_updatenotification($mode, $data)
{
global $config;
$retval = 0;
switch ($mode) {
case UPDATENOTIFY_MODE_NEW:
case UPDATENOTIFY_MODE_MODIFIED:
break;
case UPDATENOTIFY_MODE_DIRTY:
$cnid = array_search_ex($data, $config['staticroutes']['route'], "uuid");
if (FALSE !== $index) {
rc_exec_service("routing delete conf_" . strtr($config['staticroutes']['route'][$cnid]['uuid'], "-", "_"));
unset($config['staticroutes']['route'][$cnid]);
write_config();
}
break;
}
return $retval;
}
示例3: isset
$config['ad']['domainname_dns'] = $_POST['domainname_dns'];
$config['ad']['domainname_netbios'] = $_POST['domainname_netbios'];
$config['ad']['username'] = $_POST['username'];
$config['ad']['password'] = $_POST['password'];
$config['ad']['enable'] = isset($_POST['enable']) ? true : false;
if ($config['ad']['enable']) {
$config['samba']['enable'] = true;
$config['samba']['security'] = "ads";
$config['samba']['workgroup'] = $_POST['domainname_netbios'];
}
write_config();
$retval = 0;
if (!file_exists($d_sysrebootreqd_path)) {
config_lock();
rc_exec_service("pam");
rc_exec_service("ldap");
rc_start_service("nsswitch");
rc_update_service("samba");
config_unlock();
}
$savemsg = get_std_save_message($retval);
}
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function enable_change(enable_change) {
var endis = !(document.iform.enable.checked || enable_change);
document.iform.domaincontrollername.disabled = endis;
document.iform.domainname_dns.disabled = endis;
示例4: array
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the NAS4Free Project.
*/
require "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("Services"), gettext("Rsync"), gettext("Local"));
if ($_POST) {
$pconfig = $_POST;
if (isset($_POST['apply']) && $_POST['apply']) {
$retval = 0;
if (!file_exists($d_sysrebootreqd_path)) {
$retval |= updatenotify_process("rsynclocal", "rsynclocal_process_updatenotification");
config_lock();
$retval |= rc_exec_service("rsync_local");
$retval |= rc_update_service("cron");
config_unlock();
}
$savemsg = get_std_save_message($retval);
if ($retval == 0) {
updatenotify_delete("rsynclocal");
}
}
}
if (!isset($config['rsync']) || !is_array($config['rsync'])) {
$config['rsync'] = array();
if (!isset($config['rsync']['rsynclocal']) || !is_array($config['rsync']['rsynclocal'])) {
$config['rsync']['rsynclocal'] = array();
}
} else {
示例5: unset
$config['kerberos']['ldapauxparam'][] = $auxparam;
}
}
unset($config['kerberos']['sssdauxparam']);
foreach (explode("\n", $_POST['sssdauxparam']) as $auxparam) {
$auxparam = trim($auxparam, "\t\n\r");
if (!empty($auxparam)) {
$config['kerberos']['sssdauxparam'][] = $auxparam;
}
}
$config['kerberos']['enable'] = isset($_POST['enable']) ? true : false;
write_config();
$retval = 0;
if (!file_exists($d_sysrebootreqd_path)) {
config_lock();
rc_exec_service("kerberos");
$retval |= rc_update_service("sssd");
config_unlock();
}
$savemsg = get_std_save_message($retval);
}
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
var types = [ 'sss', 'ldap' ];
function enable_change(enable_change) {
var endis = !(document.iform.enable.checked || enable_change);
document.iform.kdc.disabled = endis;
示例6: array
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the NAS4Free Project.
*/
require "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("System"), gettext("Advanced"), gettext("rc.conf"));
if ($_POST) {
if (isset($_POST['apply']) && $_POST['apply']) {
$retval = 0;
if (!file_exists($d_sysrebootreqd_path)) {
$retval |= updatenotify_process("rcconf", "rcconf_process_updatenotification");
config_lock();
$retval |= rc_exec_service("rcconf");
config_unlock();
}
$savemsg = get_std_save_message($retval);
if ($retval == 0) {
updatenotify_delete("rcconf");
}
}
}
if (!isset($config['system']['rcconf']['param']) || !is_array($config['system']['rcconf']['param'])) {
$config['system']['rcconf']['param'] = array();
}
array_sort_key($config['system']['rcconf']['param'], "name");
$a_rcvar =& $config['system']['rcconf']['param'];
if (isset($_GET['act']) && $_GET['act'] === "del") {
if ($_GET['uuid'] === "all") {
示例7: array
*/
require "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("Access"), gettext("Users"));
if ($_POST) {
$pconfig = $_POST;
if ($_POST['apply']) {
$retval = 0;
if (!file_exists($d_sysrebootreqd_path)) {
$retval |= updatenotify_process("userdb_user", "userdbuser_process_updatenotification");
config_lock();
$retval |= rc_exec_service("userdb");
$retval |= rc_exec_service("websrv_htpasswd");
$retval |= rc_exec_service("webfm");
if (isset($config['samba']['enable'])) {
$retval |= rc_exec_service("smbpasswd");
$retval |= rc_update_service("samba");
}
config_unlock();
}
$savemsg = get_std_save_message($retval);
if ($retval == 0) {
updatenotify_delete("userdb_user");
}
}
}
if (!is_array($config['access']['user'])) {
$config['access']['user'] = array();
}
array_sort_key($config['access']['user'], "login");
$a_user =& $config['access']['user'];
示例8: base64_encode
$config['system']['tune'] = $_POST['tune_enable'] ? true : false;
$config['system']['zeroconf'] = $_POST['zeroconf'] ? true : false;
$config['system']['powerd'] = $_POST['powerd'] ? true : false;
$config['system']['motd'] = base64_encode($_POST['motd']);
// Encode string, otherwise line breaks will get lost
$config['system']['sysconsaver']['enable'] = $_POST['sysconsaver'] ? true : false;
$config['system']['sysconsaver']['blanktime'] = $_POST['sysconsaverblanktime'];
$config['system']['enableserialconsole'] = $_POST['enableserialconsole'] ? true : false;
write_config();
$retval = 0;
if (!file_exists($d_sysrebootreqd_path)) {
config_lock();
$retval |= rc_exec_service("rcconf.sh");
$retval |= rc_update_service("powerd");
$retval |= rc_update_service("mdnsresponder");
$retval |= rc_exec_service("motd");
if (isset($config['system']['tune'])) {
$retval |= rc_update_service("sysctl");
}
$retval |= rc_update_service("syscons");
config_unlock();
}
$savemsg = get_std_save_message($retval);
}
}
function sysctl_tune($mode)
{
global $config;
if (!is_array($config['system']['sysctl']['param'])) {
$config['system']['sysctl']['param'] = array();
}
示例9: TORT
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 "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("Access"), gettext("Groups"));
if ($_POST) {
$pconfig = $_POST;
if ($_POST['apply']) {
$retval = 0;
if (!file_exists($d_sysrebootreqd_path)) {
$retval |= updatenotify_process("userdb_group", "userdbgroup_process_updatenotification");
config_lock();
$retval |= rc_exec_service("userdb");
config_unlock();
}
$savemsg = get_std_save_message($retval);
if ($retval == 0) {
updatenotify_delete("userdb_group");
}
}
}
if (!is_array($config['access']['group'])) {
$config['access']['group'] = array();
}
array_sort_key($config['access']['group'], "name");
$a_group_conf =& $config['access']['group'];
$a_group = system_get_group_list();
if ($_GET['act'] === "del") {
示例10: gettext
$input_errors[] = gettext("The new password does not match. Please ensure the passwords match exactly.");
}
// Check Webserver document root if auth is required
if (isset($config['websrv']['enable']) && isset($config['websrv']['authentication']['enable']) && !is_dir($config['websrv']['documentroot'])) {
$input_errors[] = gettext("Webserver document root is missing.");
}
if (empty($input_errors)) {
$config['system']['password'] = mkpasswd($_POST['password_new']);
write_config();
$retval = 0;
if (!file_exists($d_sysrebootreqd_path)) {
config_lock();
$retval |= rc_exec_service("userdb");
$retval |= rc_exec_service("htpasswd");
$retval |= rc_exec_service("websrv_htpasswd");
$retval |= rc_exec_service("fmperm");
config_unlock();
}
$savemsg = get_std_save_message($retval);
}
}
include "fbegin.inc";
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tabnavtbl">
<ul id="tabnav">
<li class="tabinact"><a href="system.php"><span><?php
echo gettext("General");
?>
</span></a></li>
示例11: isset
}
if (empty($input_errors)) {
$config['system']['email']['server'] = $_POST['server'];
$config['system']['email']['port'] = $_POST['port'];
$config['system']['email']['auth'] = isset($_POST['auth']) ? true : false;
$config['system']['email']['authmethod'] = $_POST['authmethod'];
$config['system']['email']['security'] = $_POST['security'];
$config['system']['email']['starttls'] = isset($_POST['starttls']) ? true : false;
$config['system']['email']['username'] = $_POST['username'];
$config['system']['email']['password'] = $_POST['password'];
$config['system']['email']['from'] = $_POST['from'];
write_config();
$retval = 0;
if (!file_exists($d_sysrebootreqd_path)) {
config_lock();
$retval |= rc_exec_service("msmtp");
config_unlock();
}
// Send test email.
if (stristr($_POST['Submit'], gettext("Send test email"))) {
$subject = sprintf(gettext("Test email from host: %s"), system_get_hostname());
$message = gettext("This email has been sent to validate your email configuration.");
$retval = @email_send($config['system']['email']['from'], $subject, $message, $error);
if (0 == $retval) {
$savemsg = gettext("Test email successfully sent.");
write_log(sprintf(gettext("Test email successfully sent to: %s."), $config['system']['email']['from']));
} else {
$failmsg = sprintf(gettext("Failed to send test email. Please check the <a href='%s'>log</a> files."), "diag_log.php");
write_log(sprintf(gettext("Failed to send test email to: %s."), $config['system']['email']['from']));
}
} else {
示例12: array
*/
require "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("Access"), gettext("Users"));
if ($_POST) {
$pconfig = $_POST;
if (isset($_POST['apply']) && $_POST['apply']) {
$retval = 0;
if (!file_exists($d_sysrebootreqd_path)) {
$retval |= updatenotify_process("userdb_user", "userdbuser_process_updatenotification");
config_lock();
$retval |= rc_exec_service("userdb");
$retval |= rc_exec_service("websrv_htpasswd");
$retval |= rc_exec_service("fmperm");
if (isset($config['samba']['enable'])) {
$retval |= rc_exec_service("passdb");
$retval |= rc_update_service("samba");
}
config_unlock();
}
$savemsg = get_std_save_message($retval);
if ($retval == 0) {
updatenotify_delete("userdb_user");
}
}
}
if (!isset($config['access']['user']) || !is_array($config['access']['user'])) {
$config['access']['user'] = array();
}
array_sort_key($config['access']['user'], "login");
$a_user =& $config['access']['user'];
示例13: htmlspecialchars
foreach ($rawdata as $line) {
echo htmlspecialchars($line)."\n";
}
*/
$handle = popen("{$cmd} 2>&1", "r");
while (!feof($handle)) {
$line = fgets($handle);
echo htmlspecialchars($line);
ob_flush();
flush();
}
$result = pclose($handle);
echo '</pre>';
if ($result == 0) {
rename("/var/etc/smb4.conf", "{$path}/smb4.conf.created");
rc_exec_service("resolv");
}
}
?>
<div id="remarks">
<?php
html_remark("note", gettext("Note"), sprintf("<div id='enumeration'><ul><li>%s</li><li>%s</li><li>%s</li></ul></div>", gettext("All data in the path is overwritten. To avoid invalid data/permission, using empty UFS directory is recommended."), sprintf(gettext("Check <a href=\"%s\">System|General Setup</a> before initializing."), "system.php"), ""));
?>
</div>
<?php
include "formend.inc";
?>
</form>
</td>
</tr>
</table>
示例14: gettext
$input_errors[] = gettext("The confimed password does not match. Please ensure the passwords match exactly.");
}
// Check Webserver document root if auth is required
if (isset($config['websrv']['enable']) && isset($config['websrv']['authentication']['enable']) && !is_dir($config['websrv']['documentroot'])) {
$input_errors[] = gettext("Webserver document root is missing.");
}
if (!$input_errors) {
$config['system']['password'] = $_POST['password_new'];
write_config();
$retval = 0;
if (!file_exists($d_sysrebootreqd_path)) {
config_lock();
$retval |= rc_exec_service("userdb");
$retval |= rc_exec_service("htpasswd");
$retval |= rc_exec_service("websrv_htpasswd");
$retval |= rc_exec_service("webfm");
config_unlock();
}
$savemsg = get_std_save_message($retval);
}
}
include "fbegin.inc";
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tabnavtbl">
<ul id="tabnav">
<li class="tabinact"><a href="system.php"><span><?php
echo gettext("General");
?>
</span></a></li>
示例15: strtoupper
if (!isset($config['interfaces'][$ifname]['descr'])) {
$config['interfaces'][$ifname]['descr'] = strtoupper($ifname);
}
}
}
}
}
write_config();
touch($d_sysrebootreqd_path);
}
}
if (isset($_GET['act']) && $_GET['act'] == "del") {
$id = $_GET['id'];
$ifn = $config['interfaces'][$id]['if'];
// Stop interface.
rc_exec_service("netif stop {$ifn}");
// Remove ifconfig_xxx and ipv6_ifconfig_xxx entries.
mwexec("/usr/local/sbin/rconf attribute remove 'ifconfig_{$ifn}'");
mwexec("/usr/local/sbin/rconf attribute remove 'ipv6_ifconfig_{$ifn}'");
unset($config['interfaces'][$id]);
/* delete the specified OPTn */
/* shift down other OPTn interfaces to get rid of holes */
$i = substr($id, 3);
/* the number of the OPTn port being deleted */
$i++;
/* look at the following OPTn ports */
while (isset($config['interfaces']['opt' . $i]) && is_array($config['interfaces']['opt' . $i])) {
$config['interfaces']['opt' . ($i - 1)] = $config['interfaces']['opt' . $i];
if ($config['interfaces']['opt' . ($i - 1)]['descr'] == "OPT" . $i) {
$config['interfaces']['opt' . ($i - 1)]['descr'] = "OPT" . ($i - 1);
}