summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-09-30 14:33:29 -0300
committerRenato Botelho <renato@netgate.com>2015-09-30 14:33:37 -0300
commit2344bed478676b498a014dcec618db37e3422fd1 (patch)
treef278a4652a311ce1935d40e626ec4310b45737b6
parentc580e34c6fe24107817d6a72956e77b23f043beb (diff)
downloadpfsense-2344bed478676b498a014dcec618db37e3422fd1.zip
pfsense-2344bed478676b498a014dcec618db37e3422fd1.tar.gz
Use product_name global variable in more places
-rw-r--r--src/etc/inc/config.lib.inc6
-rw-r--r--src/etc/inc/pfsense-utils.inc2
-rw-r--r--src/etc/inc/rrd.inc4
-rw-r--r--src/etc/inc/services.inc4
-rw-r--r--src/etc/inc/upgrade_config.inc6
-rw-r--r--src/etc/phpshellsessions/gitsync4
-rwxr-xr-xsrc/etc/rc.bootup2
-rw-r--r--src/usr/local/www/diag_logs_settings.php4
-rwxr-xr-xsrc/usr/local/www/head.inc6
-rw-r--r--src/usr/local/www/index.php2
-rw-r--r--src/usr/local/www/system_advanced_admin.php2
-rw-r--r--src/usr/local/www/system_advanced_misc.php2
-rw-r--r--src/usr/local/www/system_firmware_settings.php4
13 files changed, 24 insertions, 24 deletions
diff --git a/src/etc/inc/config.lib.inc b/src/etc/inc/config.lib.inc
index cda88a6..0ea97b3 100644
--- a/src/etc/inc/config.lib.inc
+++ b/src/etc/inc/config.lib.inc
@@ -326,7 +326,7 @@ function conf_mount_rw() {
global $g, $config;
/* do not mount on cdrom platform */
- if ($g['platform'] == "cdrom" or $g['platform'] == "pfSense") {
+ if ($g['platform'] == "cdrom" or $g['platform'] == $g['product_name']) {
return;
}
@@ -342,7 +342,7 @@ function conf_mount_rw() {
$status = mwexec("/sbin/mount -u -w -o sync,noatime {$g['cf_path']}");
}
- /* if the platform is soekris or wrap or pfSense, lets mount the
+ /* if the platform is soekris or wrap or $product, lets mount the
* compact flash cards root.
*/
$status = mwexec("/sbin/mount -u -w -o sync,noatime /");
@@ -367,7 +367,7 @@ function conf_mount_ro() {
/* Do not trust $g['platform'] since this can be clobbered during factory reset. */
$platform = trim(file_get_contents("/etc/platform"));
/* do not umount on cdrom or pfSense platforms */
- if ($platform == "cdrom" or $platform == "pfSense") {
+ if ($platform == "cdrom" or $platform == $g['product_name']) {
return;
}
diff --git a/src/etc/inc/pfsense-utils.inc b/src/etc/inc/pfsense-utils.inc
index caff887..4eefaa0 100644
--- a/src/etc/inc/pfsense-utils.inc
+++ b/src/etc/inc/pfsense-utils.inc
@@ -1122,7 +1122,7 @@ function is_serial_enabled() {
if (!isset($g['enableserial_force']) &&
!isset($config['system']['enableserial']) &&
- ($g['platform'] == "pfSense" || $g['platform'] == "cdrom")) {
+ ($g['platform'] == $g['product_name'] || $g['platform'] == "cdrom")) {
return false;
}
diff --git a/src/etc/inc/rrd.inc b/src/etc/inc/rrd.inc
index 86148d6..8d4f194 100644
--- a/src/etc/inc/rrd.inc
+++ b/src/etc/inc/rrd.inc
@@ -55,7 +55,7 @@ function restore_rrd() {
$rrdrestore = "";
$rrdreturn = "";
- if (file_exists("{$g['cf_conf_path']}/rrd.tgz") && (isset($config['system']['use_mfs_tmpvar']) || $g['platform'] != "pfSense")) {
+ if (file_exists("{$g['cf_conf_path']}/rrd.tgz") && (isset($config['system']['use_mfs_tmpvar']) || $g['platform'] != $g['product_name'])) {
foreach (glob("{$rrddbpath}/*.xml") as $xml_file) {
@unlink($xml_file);
}
@@ -87,7 +87,7 @@ function restore_rrd() {
unset($rrdrestore);
@unlink("{$g['tmp_path']}/rrd_restore");
/* If this backup is still there on a full install, but we aren't going to use ram disks, remove the archive since this is a transition. */
- if (($g['platform'] == "pfSense") && !isset($config['system']['use_mfs_tmpvar'])) {
+ if (($g['platform'] == $g['product_name']) && !isset($config['system']['use_mfs_tmpvar'])) {
unlink_if_exists("{$g['cf_conf_path']}/rrd.tgz");
}
return true;
diff --git a/src/etc/inc/services.inc b/src/etc/inc/services.inc
index 9d64509..37fdf46 100644
--- a/src/etc/inc/services.inc
+++ b/src/etc/inc/services.inc
@@ -471,7 +471,7 @@ function services_dhcpdv4_configure() {
}
}
/* If this backup is still there on a full install, but we aren't going to use ram disks, remove the archive since this is a transition. */
- if (($g['platform'] == "pfSense") && !isset($config['system']['use_mfs_tmpvar'])) {
+ if (($g['platform'] == $g['product_name']) && !isset($config['system']['use_mfs_tmpvar'])) {
unlink_if_exists("{$g['cf_conf_path']}/dhcpleases.tgz");
}
}
@@ -1185,7 +1185,7 @@ function services_dhcpdv6_configure($blacklist = array()) {
}
if (platform_booting()) {
- if ($g['platform'] != "pfSense") {
+ if ($g['platform'] != $g['product_name']) {
/* restore the leases, if we have them */
if (file_exists("{$g['cf_conf_path']}/dhcp6leases.tgz")) {
$dhcprestore = "";
diff --git a/src/etc/inc/upgrade_config.inc b/src/etc/inc/upgrade_config.inc
index 49f0eae..9bf570e 100644
--- a/src/etc/inc/upgrade_config.inc
+++ b/src/etc/inc/upgrade_config.inc
@@ -2082,7 +2082,7 @@ function upgrade_054_to_055() {
$rrddbpath = "/var/db/rrd/";
$rrdtool = "/usr/bin/nice -n20 /usr/local/bin/rrdtool";
- if ($g['platform'] != "pfSense") {
+ if ($g['platform'] != $g['product_name']) {
/* restore the databases, if we have one */
if (restore_rrd()) {
/* Make sure to move the rrd backup out of the way. We will make a new one after converting. */
@@ -2811,7 +2811,7 @@ function upgrade_080_to_081() {
$rrddbpath = "/var/db/rrd/";
$rrdtool = "/usr/bin/nice -n20 /usr/local/bin/rrdtool";
- if ($g['platform'] != "pfSense") {
+ if ($g['platform'] != $g['product_name']) {
/* restore the databases, if we have one */
if (restore_rrd()) {
/* Make sure to move the rrd backup out of the way. We will make a new one after converting. */
@@ -3283,7 +3283,7 @@ function upgrade_095_to_096() {
$rrddbpath = "/var/db/rrd";
$rrdtool = "/usr/local/bin/rrdtool";
- if ($g['platform'] != "pfSense") {
+ if ($g['platform'] != $g['product_name']) {
/* restore the databases, if we have one */
if (restore_rrd()) {
/* Make sure to move the rrd backup out of the way. We will make a new one after converting. */
diff --git a/src/etc/phpshellsessions/gitsync b/src/etc/phpshellsessions/gitsync
index 751f69a..25d1996 100644
--- a/src/etc/phpshellsessions/gitsync
+++ b/src/etc/phpshellsessions/gitsync
@@ -218,7 +218,7 @@ if (!$args[0] && !$upgrading) {
} while (!empty($merge_repo));
}
-if ($branch == "RESTORE" && $g['platform'] == "pfSense") {
+if ($branch == "RESTORE" && $g['platform'] == $g['product_name']) {
if (!file_exists("/root/cvssync_backup.tgz")) {
echo "Sorry, we could not find a previous CVSSync backup file.\n";
conf_mount_ro();
@@ -331,7 +331,7 @@ exec("rm -f ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/src/etc/syslog.conf 2>/dev/nu
echo "===> Installing new files...\n";
-if ($g['platform'] == "pfSense") {
+if ($g['platform'] == $g['product_name']) {
$command = "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO ; tar -cpf - {$files_to_copy} | (cd / ; tar -Uxpf -)";
} else {
$command = "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO ; tar -cpf - {$files_to_copy} | (cd / ; tar -xpf -) 2>/dev/null";
diff --git a/src/etc/rc.bootup b/src/etc/rc.bootup
index d27f795..21ef089 100755
--- a/src/etc/rc.bootup
+++ b/src/etc/rc.bootup
@@ -396,7 +396,7 @@ if (file_exists("/sbin/shutdown.old")) {
if (file_exists('/conf/needs_package_sync')) {
if ($config['installedpackages'] <> '' && is_array($config['installedpackages']['package'])) {
require_once("pkg-utils.inc");
- if ($g['platform'] == "pfSense" || $g['platform'] == "nanobsd") {
+ if ($g['platform'] == $g['product_name'] || $g['platform'] == "nanobsd") {
mark_subsystem_dirty('packagelock');
pkg_reinstall_all();
clear_subsystem_dirty('packagelock');
diff --git a/src/usr/local/www/diag_logs_settings.php b/src/usr/local/www/diag_logs_settings.php
index 255c98f..271d6a0 100644
--- a/src/usr/local/www/diag_logs_settings.php
+++ b/src/usr/local/www/diag_logs_settings.php
@@ -331,7 +331,7 @@ $section->addInput(new Form_Select(
$section->addInput(new Form_Checkbox(
'disablelocallogging',
'Local Logging',
- $g['platform'] == 'pfSense' ? "Disable writing log files to the local disk" : "Disable writing log files to the local RAM disk",
+ $g['platform'] == $g['product_name'] ? "Disable writing log files to the local disk" : "Disable writing log files to the local RAM disk",
$pconfig['disablelocallogging']
));
@@ -548,4 +548,4 @@ events.push(function(){
</script>
<?php
-include("foot.inc"); \ No newline at end of file
+include("foot.inc");
diff --git a/src/usr/local/www/head.inc b/src/usr/local/www/head.inc
index 54a05a4..2621cc0 100755
--- a/src/usr/local/www/head.inc
+++ b/src/usr/local/www/head.inc
@@ -182,7 +182,7 @@ $system_menu[] = array(gettext("Advanced"), "/system_advanced_admin.php");
$system_menu[] = array(gettext("Firmware"), "/system_firmware.php");
$system_menu[] = array(gettext("General Setup"), "/system.php");
$system_menu[] = array(gettext("High Avail. Sync"), "/system_hasync.php");
-if ($g['platform'] == "pfSense" or $g['platform'] == "nanobsd") {
+if ($g['platform'] == $g['product_name'] or $g['platform'] == "nanobsd") {
$system_menu[] = array(gettext("Packages"), "/pkg_mgr_installed.php");
}
$system_menu[] = array(gettext("Setup Wizard"), "/wizard.php?xml=setup_wizard.xml");
@@ -275,7 +275,7 @@ $status_menu[] = array(gettext("Load Balancer"), "/status_lb_pool.php");
$status_menu[] = array(gettext("NTP"), "/status_ntpd.php");
$status_menu[] = array(gettext("OpenVPN"), "/status_openvpn.php");
-if ($g['platform'] == "pfSense") {
+if ($g['platform'] == $g['product_name']) {
$status_menu[] = array(gettext("Package Logs"), "/diag_pkglogs.php");
}
@@ -558,4 +558,4 @@ if (are_notices_pending()):?>
}
</script>
-<?php endif; \ No newline at end of file
+<?php endif;
diff --git a/src/usr/local/www/index.php b/src/usr/local/www/index.php
index 1810284..8b80259 100644
--- a/src/usr/local/www/index.php
+++ b/src/usr/local/www/index.php
@@ -151,7 +151,7 @@ if (file_exists("/usr/sbin/swapinfo")) {
## If packages are installed lets resync
if (file_exists('/conf/needs_package_sync')) {
if ($config['installedpackages'] <> '' && is_array($config['installedpackages']['package'])) {
- if ($g['platform'] == "pfSense" || $g['platform'] == "nanobsd") {
+ if ($g['platform'] == $g['product_name'] || $g['platform'] == "nanobsd") {
## If the user has logged into webGUI quickly while the system is booting then do not redirect them to
## the package reinstall page. That is about to be done by the boot script anyway.
## The code in head.inc will put up a notice to the user.
diff --git a/src/usr/local/www/system_advanced_admin.php b/src/usr/local/www/system_advanced_admin.php
index edc6334..e98ad4f 100644
--- a/src/usr/local/www/system_advanced_admin.php
+++ b/src/usr/local/www/system_advanced_admin.php
@@ -474,7 +474,7 @@ $section->addInput(new Form_Input(
))->setHelp('Note: Leave this blank for the default of 22.');
-if (!$g['enableserial_force'] && ($g['platform'] == "pfSense" || $g['platform'] == "cdrom"))
+if (!$g['enableserial_force'] && ($g['platform'] == $g['product_name'] || $g['platform'] == "cdrom"))
{
$form->add($section);
$section = new Form_Section('Serial Communications');
diff --git a/src/usr/local/www/system_advanced_misc.php b/src/usr/local/www/system_advanced_misc.php
index 08c235a..dbf5f7a 100644
--- a/src/usr/local/www/system_advanced_misc.php
+++ b/src/usr/local/www/system_advanced_misc.php
@@ -536,7 +536,7 @@ $section->addInput(new Form_Checkbox(
'use_mfs_tmpvar',
'Use RAM Disks',
'Use memory file system for /tmp and /var',
- ($pconfig['use_mfs_tmpvar'] || $g['platform'] != "pfSense")
+ ($pconfig['use_mfs_tmpvar'] || $g['platform'] != $g['product_name'])
))->setHelp('Set this if you wish to use /tmp and /var as RAM disks (memory file '.
'system disks) on a full install rather than use the hard disk. Setting this will '.
'cause the data in /tmp and /var to be lost at reboot, including log data. RRD '.
diff --git a/src/usr/local/www/system_firmware_settings.php b/src/usr/local/www/system_firmware_settings.php
index aaf9089..e9f576c 100644
--- a/src/usr/local/www/system_firmware_settings.php
+++ b/src/usr/local/www/system_firmware_settings.php
@@ -183,7 +183,7 @@ $section->addInput(new Form_Checkbox(
$form->add($section);
-if(file_exists("/usr/local/bin/git") && $g['platform'] == "pfSense") {
+if(file_exists("/usr/local/bin/git") && $g['platform'] == $g['product_name']) {
$section = new Form_Section('GitSync');
$section->addInput(new Form_Checkbox(
@@ -257,4 +257,4 @@ update_firmwareurl();
</script>
<?php
-include("foot.inc"); \ No newline at end of file
+include("foot.inc");
OpenPOWER on IntegriCloud