diff options
author | Renato Botelho <renato@netgate.com> | 2016-05-03 17:09:01 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-05-03 17:09:01 -0300 |
commit | 3d3c8094eb9fbe2ea4a66052858a44bde201b212 (patch) | |
tree | 942786c1c9b2a97361173ecf780ccbd54b7b135a /src | |
parent | 4057a15383009f57d793466e2997e997165c410b (diff) | |
download | pfsense-3d3c8094eb9fbe2ea4a66052858a44bde201b212.zip pfsense-3d3c8094eb9fbe2ea4a66052858a44bde201b212.tar.gz |
Show patchlevel together with product version on banners and system information widget
Diffstat (limited to 'src')
-rw-r--r-- | src/etc/inc/globals.inc | 11 | ||||
-rwxr-xr-x | src/etc/rc | 16 | ||||
-rwxr-xr-x | src/etc/rc.banner | 10 | ||||
-rw-r--r-- | src/usr/local/www/widgets/widgets/system_information.widget.php | 2 |
4 files changed, 33 insertions, 6 deletions
diff --git a/src/etc/inc/globals.inc b/src/etc/inc/globals.inc index 62b51ee..1b5ba01 100644 --- a/src/etc/inc/globals.inc +++ b/src/etc/inc/globals.inc @@ -121,6 +121,17 @@ $iptos = array("lowdelay", "throughput", "reliability"); /* TCP flags */ $tcpflags = array("syn", "ack", "fin", "rst", "psh", "urg", "ece", "cwr"); +if (file_exists("/etc/version.patch")) { + $g["product_version_patch"] = trim(file_get_contents("/etc/version.patch"), " \n"); +} else { + $g["product_version_patch"] = "0"; +} + +$g['product_version_string'] = $g['product_version']; +if (is_numeric($g["product_version_patch"]) && $g["product_version_patch"] != "0") { + $g['product_version_string'] .= "-p{$g['product_version_patch']}"; +} + if (file_exists("/etc/platform")) { $arch = php_uname("m"); @@ -25,6 +25,18 @@ PLATFORM=`/bin/cat /etc/platform` # Set our current version version=`/bin/cat /etc/version` +# Version patch +version_patch="0" +if [ -f /etc/version.patch ]; then + version_patch=`/bin/cat /etc/version.patch` +fi + +if [ "${version_patch}" = "0" ]; then + version_patch="" +else + version_patch=" (Patch ${version_patch})" +fi + # Read product_name from $g, defaults to pfSense # Use php -n here because we are not ready to load extensions yet product=$(/usr/local/bin/php -n /usr/local/sbin/read_global_var product_name pfSense) @@ -185,7 +197,7 @@ echo cat /etc/ascii-art/pfsense-logo-small.txt echo echo -echo "Welcome to ${product} ${version}${platformbanner}..." +echo "Welcome to ${product} ${version}${version_patch}${platformbanner}..." echo /sbin/conscontrol mute off >/dev/null @@ -439,7 +451,7 @@ fi # Log product version to syslog BUILDTIME=`cat /etc/version.buildtime` ARCH=`uname -m` -echo "$product ($PLATFORM) $version $ARCH $BUILDTIME" +echo "$product ($PLATFORM) ${version}${version_patch} $ARCH $BUILDTIME" echo "Bootup complete" diff --git a/src/etc/rc.banner b/src/etc/rc.banner index 6204d29..fbd4ba0 100755 --- a/src/etc/rc.banner +++ b/src/etc/rc.banner @@ -34,17 +34,21 @@ require_once("gwlb.inc"); require_once("interfaces.inc"); - $platform = trim(file_get_contents("{$g['etc_path']}/platform")); $hostname = $config['system']['hostname']; $product = $g['product_name']; $machine = trim(`uname -m`); $hideplatform = $g['hideplatform']; if (!$hideplatform) { - $platformbanner = "-{$platform}"; + if ($g['platform'] == $g['product_name']) { + $platform = "full-install"; + } else { + $platform = $g['platform']; + } + $platformbanner = " {$platform}"; } - print "*** Welcome to {$product} {$g['product_version']}{$platformbanner} ({$machine}) on {$hostname} ***\n"; + print "*** Welcome to {$product} {$g['product_version_string']} ({$machine}{$platformbanner}) on {$hostname} ***\n"; $iflist = get_configured_interface_with_descr(false, true); foreach ($iflist as $ifname => $friendly) { diff --git a/src/usr/local/www/widgets/widgets/system_information.widget.php b/src/usr/local/www/widgets/widgets/system_information.widget.php index 461a686..aa1ea06 100644 --- a/src/usr/local/www/widgets/widgets/system_information.widget.php +++ b/src/usr/local/www/widgets/widgets/system_information.widget.php @@ -120,7 +120,7 @@ $filesystems = get_mounted_filesystems(); <tr> <th><?=gettext("Version");?></th> <td> - <strong><?=$g['product_version']?></strong> + <strong><?=$g['product_version_string']?></strong> (<?php echo php_uname("m"); ?>) <br /> <?=gettext('built on')?> <?php readfile("/etc/version.buildtime"); ?> |