mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 17:44:41 +00:00
inc: shift more functions to their rightful place
This commit is contained in:
parent
21803172ce
commit
2108673851
@ -93,21 +93,6 @@ function get_carp_interface_status($carpinterface) {
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* backup_config_section($section): returns as an xml file string of
|
||||
* the configuration section
|
||||
*/
|
||||
function backup_config_section($section_name) {
|
||||
global $config;
|
||||
$new_section = &$config[$section_name];
|
||||
/* generate configuration XML */
|
||||
$xmlconfig = dump_xml_config($new_section, $section_name);
|
||||
$xmlconfig = str_replace("<?xml version=\"1.0\"?>", "", $xmlconfig);
|
||||
return $xmlconfig;
|
||||
}
|
||||
|
||||
/* KEEP THIS: unbreaks syntax highlighting <?php */
|
||||
|
||||
/*
|
||||
* restore_config_section($section_name, new_contents): restore a configuration section,
|
||||
* and write the configuration out
|
||||
@ -149,26 +134,6 @@ function restore_config_section($section_name, $new_contents)
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* host_firmware_version(): Return the versions used in this install
|
||||
*/
|
||||
function host_firmware_version()
|
||||
{
|
||||
global $config;
|
||||
|
||||
return array(
|
||||
'firmware' => array('version' => file_get_contents('/usr/local/opnsense/version/opnsense')),
|
||||
'kernel' => array('version' => file_get_contents('/usr/local/opnsense/version/opnsense-update.kernel')),
|
||||
'base' => array('version' => file_get_contents('/usr/local/opnsense/version/opnsense-update.base')),
|
||||
'config_version' => $config['version']
|
||||
);
|
||||
}
|
||||
|
||||
function reload_all()
|
||||
{
|
||||
configd_run('service reload all', true);
|
||||
}
|
||||
|
||||
function setup_serial_port($sync = true)
|
||||
{
|
||||
global $config;
|
||||
@ -250,25 +215,6 @@ function reload_ttys()
|
||||
exec('/bin/kill -HUP 1');
|
||||
}
|
||||
|
||||
|
||||
/* Any PPPoE servers enabled? */
|
||||
function is_pppoe_server_enabled()
|
||||
{
|
||||
global $config;
|
||||
$pppoeenable = false;
|
||||
if (!isset($config['pppoes']['pppoe']) || !is_array($config['pppoes']['pppoe'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($config['pppoes']['pppoe'] as $pppoes) {
|
||||
if ($pppoes['mode'] == 'server') {
|
||||
$pppoeenable = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $pppoeenable;
|
||||
}
|
||||
|
||||
function add_hostname_to_watch($hostname) {
|
||||
if (!is_dir("/var/db/dnscache")) {
|
||||
mkdir("/var/db/dnscache");
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
Copyright (C) 2015-2016 Deciso B.V.
|
||||
Copyright (C) 2009, 2010 Scott Ullrich
|
||||
Copyright (C) 2004-2010 Scott Ullrich
|
||||
Copyright (C) 2005 Colin Smith
|
||||
All rights reserved.
|
||||
|
||||
@ -100,14 +100,19 @@ function merge_config_attributes(&$cnf_source, &$cnf_dest)
|
||||
|
||||
/**
|
||||
* retrieve firmware version
|
||||
* @return mixed
|
||||
* @return array
|
||||
*/
|
||||
function firmware_version_xmlrpc()
|
||||
{
|
||||
require_once("pfsense-utils.inc");
|
||||
return host_firmware_version();
|
||||
}
|
||||
global $config;
|
||||
|
||||
return array(
|
||||
'kernel' => array('version' => file_get_contents('/usr/local/opnsense/version/opnsense-update.kernel')),
|
||||
'base' => array('version' => file_get_contents('/usr/local/opnsense/version/opnsense-update.base')),
|
||||
'firmware' => array('version' => file_get_contents('/usr/local/opnsense/version/opnsense')),
|
||||
'config_version' => $config['version'],
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* filter reconfigure
|
||||
|
||||
@ -632,7 +632,7 @@
|
||||
</description>
|
||||
<stepafterformdisplay>
|
||||
<![CDATA[
|
||||
reload_all();
|
||||
configd_run('service reload all', true);
|
||||
]]>
|
||||
</stepafterformdisplay>
|
||||
</step>
|
||||
|
||||
@ -40,6 +40,21 @@ require_once("rrd.inc");
|
||||
require_once("system.inc");
|
||||
require_once("pfsense-utils.inc");
|
||||
|
||||
/*
|
||||
* backup_config_section($section): returns as an xml file string of
|
||||
* the configuration section
|
||||
*/
|
||||
function backup_config_section($section_name) {
|
||||
global $config;
|
||||
$new_section = &$config[$section_name];
|
||||
/* generate configuration XML */
|
||||
$xmlconfig = dump_xml_config($new_section, $section_name);
|
||||
$xmlconfig = str_replace("<?xml version=\"1.0\"?>", "", $xmlconfig);
|
||||
return $xmlconfig;
|
||||
}
|
||||
|
||||
/* KEEP THIS: unbreaks syntax highlighting <?php */
|
||||
|
||||
function rrd_data_xml() {
|
||||
$rrddbpath = '/var/db/rrd';
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user