From bc1ff72e019416d1aaced3810c8d50b79450af10 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 4 Sep 2017 08:31:43 +0200 Subject: [PATCH] firmware: fix upgrade when major upgrades are allowed but not available; closes #1804 We abort on error, the error is that the file is not there. Mea culpa. --- src/etc/rc.firmware.subr | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/etc/rc.firmware.subr b/src/etc/rc.firmware.subr index ca7923e7b..f374465b5 100755 --- a/src/etc/rc.firmware.subr +++ b/src/etc/rc.firmware.subr @@ -27,6 +27,7 @@ set -e +UPGRADEFILE="/usr/local/opnsense/firmware-upgrade" LOCKFILE="/tmp/pkg_upgrade.progress" PIPEFILE="/tmp/pkg_upgrade.pipe" TEE="/usr/bin/tee -a" @@ -34,8 +35,8 @@ RELEASE= if [ "${1}" = "upgrade" -a -n "${2}" ]; then RELEASE=${2} -elif [ "${1}" = "ALLOW_RISKY_MAJOR_UPGRADE" ]; then - RELEASE=$(cat /usr/local/opnsense/firmware-upgrade 2> /dev/null) +elif [ "${1}" = "ALLOW_RISKY_MAJOR_UPGRADE" -a -f ${UPGRADEFILE} ]; then + RELEASE=$(cat ${UPGRADEFILE}) fi : > ${LOCKFILE}