Commit e6fa852e authored by Franco Fichtner's avatar Franco Fichtner

firmware: piped status return was wrong

parent f7ffa6e4
...@@ -28,22 +28,28 @@ ...@@ -28,22 +28,28 @@
set -e set -e
LOCKFILE="/tmp/pkg_upgrade.progress" LOCKFILE="/tmp/pkg_upgrade.progress"
PIPEFILE="/tmp/pkg_upgrade.pipe"
TEE="/usr/bin/tee -a" TEE="/usr/bin/tee -a"
: > ${LOCKFILE} : > ${LOCKFILE}
rm -f ${PIPEFILE}
mkfifo ${PIPEFILE}
echo "***GOT REQUEST TO UPGRADE***" >> ${LOCKFILE} echo "***GOT REQUEST TO UPGRADE***" >> ${LOCKFILE}
if [ -z "${1}" ]; then if [ -z "${1}" ]; then
# upgrade all packages if possible # upgrade all packages if possible
opnsense-update -p 2>&1 | ${TEE} ${LOCKFILE} ${TEE} ${LOCKFILE} < ${PIPEFILE} &
opnsense-update -p 2>&1 > ${PIPEFILE}
# trigger a webgui restart to cope with changes # trigger a webgui restart to cope with changes
/usr/local/etc/rc.restart_webgui 2>&1 | ${TEE} ${LOCKFILE} ${TEE} ${LOCKFILE} < ${PIPEFILE} &
/usr/local/etc/rc.restart_webgui 2>&1 > ${PIPEFILE}
# if we can update base, we'll do that as well # if we can update base, we'll do that as well
if opnsense-update -c; then if opnsense-update -c; then
if opnsense-update -bk 2>&1 | ${TEE} ${LOCKFILE}; then ${TEE} ${LOCKFILE} < ${PIPEFILE} &
if opnsense-update -bk 2>&1 > ${PIPEFILE}; then
echo '***REBOOT***' >> ${LOCKFILE} echo '***REBOOT***' >> ${LOCKFILE}
sleep 5 sleep 5
/usr/local/etc/rc.reboot /usr/local/etc/rc.reboot
...@@ -51,7 +57,8 @@ if [ -z "${1}" ]; then ...@@ -51,7 +57,8 @@ if [ -z "${1}" ]; then
fi fi
elif [ "${1}" = "upgrade" -a -n "${2}" ]; then elif [ "${1}" = "upgrade" -a -n "${2}" ]; then
# upgrade to a major release # upgrade to a major release
if opnsense-update -ur ${2} 2>&1 | ${TEE} ${LOCKFILE}; then ${TEE} ${LOCKFILE} < ${PIPEFILE} &
if opnsense-update -ur ${2} 2>&1 > ${PIPEFILE}; then
echo '***REBOOT***' >> ${LOCKFILE} echo '***REBOOT***' >> ${LOCKFILE}
sleep 5 sleep 5
/usr/local/etc/rc.reboot /usr/local/etc/rc.reboot
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment