diff options
author | Renato Botelho <renato@netgate.com> | 2015-09-30 14:33:12 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-09-30 14:33:36 -0300 |
commit | c580e34c6fe24107817d6a72956e77b23f043beb (patch) | |
tree | 5b2a610df5a8a167ed0d32b48b03611e07489886 /src/etc/rc.reboot | |
parent | 205c51a217d29316334aebbc0cbc123794ba5160 (diff) | |
download | pfsense-c580e34c6fe24107817d6a72956e77b23f043beb.zip pfsense-c580e34c6fe24107817d6a72956e77b23f043beb.tar.gz |
Consider globals_override.inc and replace hard coded pfSense string by product_name
Diffstat (limited to 'src/etc/rc.reboot')
-rwxr-xr-x | src/etc/rc.reboot | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/etc/rc.reboot b/src/etc/rc.reboot index afdc93c..3b77520 100755 --- a/src/etc/rc.reboot +++ b/src/etc/rc.reboot @@ -9,10 +9,22 @@ fi sleep 1 -# If PLATFORM is pfSense then remove +globals_inc="/etc/inc/globals.inc" +if [ -f /etc/inc/globals_override.inc ]; then + globals_inc="/etc/inc/globals_override.inc ${globals_inc}" +fi +product=$(cat ${globals_inc} | \ + grep product_name | \ + head -n 1 | \ + sed 's/^.*=>* *//; s/["\;,]*//g') + +# product cannot be blank +product=${product:-"pfSense"} + +# If PLATFORM is $product then remove # temporary files on shutdown from /tmp/ PLATFORM=`cat /etc/platform` -if [ "$PLATFORM" = "pfSense" ]; then +if [ "$PLATFORM" = "${product}" ]; then rm -rf /tmp/* fi @@ -20,7 +32,7 @@ USE_MFS_TMPVAR=`/usr/bin/grep -c use_mfs_tmpvar /cf/conf/config.xml` DISK_NAME=`/bin/df /var/db/rrd | /usr/bin/tail -1 | /usr/bin/awk '{print $1;}'` DISK_TYPE=`/usr/bin/basename ${DISK_NAME} | /usr/bin/cut -c1-2` # If we are not on a full install, or if the full install wants RAM disks, or if the full install _was_ using RAM disks, but isn't for the next boot... -if [ "${PLATFORM}" != "pfSense" ] || [ ${USE_MFS_TMPVAR} -gt 0 ] || [ "${DISK_TYPE}" = "md" ]; then +if [ "${PLATFORM}" != "${product}" ] || [ ${USE_MFS_TMPVAR} -gt 0 ] || [ "${DISK_TYPE}" = "md" ]; then /etc/rc.backup_rrd.sh /etc/rc.backup_dhcpleases.sh fi |