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.
This commit is contained in:
Franco Fichtner 2017-09-04 08:31:43 +02:00
parent b805277a00
commit bc1ff72e01

View File

@ -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}