summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2017-02-12 10:57:10 +0545
committerRenato Botelho <renato@netgate.com>2017-02-13 09:11:42 -0200
commit3fbee4832045542c5aec17c551060ea9efd044d4 (patch)
treedb6bde7c4def6db97d9e0124d9bf72a8bf09e114
parent2722f4c257ddd532ad31a4851c4580b3bd667482 (diff)
downloadpfsense-3fbee4832045542c5aec17c551060ea9efd044d4.zip
pfsense-3fbee4832045542c5aec17c551060ea9efd044d4.tar.gz
Update version string at end of boot RELENG_2_3
When there is an upgrade, the echo here was outputting a stale value of the version. For example, on first upgrade from 2.3.3-DEVELOPMENT to 2.3.3-RC the console had: pfSense (pfSense) 2.3.3-DEVELOPMENT amd6 Sat Feb 11 14:24:27 CST 2017 Bootup complete FreeBSD/amd64 (myhost.localdomain) (ttyv0) *** Welcome to pfSense 2.3.3-RC (amd64 full-install) on myhost *** That is a bit confusing for users to be sure which version it is at this point. (cherry picked from commit c0044174800c3b509dd79906aeaf69e4c6ff1385)
-rwxr-xr-xsrc/etc/rc30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/etc/rc b/src/etc/rc
index 3e215ad..88ccfb7 100755
--- a/src/etc/rc
+++ b/src/etc/rc
@@ -67,20 +67,25 @@ export HOME PATH
# Set our operating platform
PLATFORM=`/bin/cat /etc/platform`
-# Set our current version
-version=`/bin/cat /etc/version`
+get_version ()
+{
+ # 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
-# 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
+}
-if [ "${version_patch}" = "0" ]; then
- version_patch=""
-else
- version_patch=" (Patch ${version_patch})"
-fi
+get_version
# Read product_name from $g, defaults to pfSense
# Use php -n here because we are not ready to load extensions yet
@@ -509,6 +514,7 @@ fi
/usr/local/sbin/${product}-upgrade -y -b 3
# Log product version to syslog
+get_version
BUILDTIME=`cat /etc/version.buildtime`
ARCH=`uname -m`
echo "$product ($PLATFORM) ${version}${version_patch} $ARCH $BUILDTIME"
OpenPOWER on IntegriCloud