mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Show patchlevel together with product version on banners and system information widget
This commit is contained in:
parent
f91d05dd64
commit
5a0235caa1
@ -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");
|
||||
|
||||
|
||||
16
src/etc/rc
16
src/etc/rc
@ -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"
|
||||
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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"); ?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user