diff options
author | Luiz Souza <luiz@netgate.com> | 2017-09-19 16:37:26 -0500 |
---|---|---|
committer | Luiz Souza <luiz@netgate.com> | 2017-09-19 16:38:46 -0500 |
commit | 72d2dbdf175a40ff8bd903854407ce640e350bfe (patch) | |
tree | 3fcf7653c06adce241d10a5972475b81ee460088 | |
parent | 7e0b401db2235969fd53cab4bef3078a02eea14a (diff) | |
download | pfsense-72d2dbdf175a40ff8bd903854407ce640e350bfe.zip pfsense-72d2dbdf175a40ff8bd903854407ce640e350bfe.tar.gz |
Only run swapon and rc.savecore when the SWAPDEVICE is valid.
(cherry picked from commit d988e0bbf991e28c611b194e9e6ccd99f818209b)
-rwxr-xr-x | src/etc/pfSense-rc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/etc/pfSense-rc b/src/etc/pfSense-rc index d5eca8a..09683ae 100755 --- a/src/etc/pfSense-rc +++ b/src/etc/pfSense-rc @@ -224,8 +224,10 @@ echo /sbin/conscontrol mute off >/dev/null SWAPDEVICE=`/bin/cat /etc/fstab | /usr/bin/grep swap | /usr/bin/cut -f1` -/sbin/swapon -a 2>/dev/null >/dev/null -/etc/rc.savecore +if [ -n "${SWAPDEVICE}" ]; then + /sbin/swapon -a 2>/dev/null >/dev/null + /etc/rc.savecore +fi # make some directories in /var /bin/mkdir -p $varrunpath /var/log /var/etc /var/db/entropy /var/db/rrd /var/at/jobs/ /var/empty /var/log/nginx 2>/dev/null |