mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
firmware: handle script errors by aborting the upgrade #6594
The individual scripts should return an error and clean up their state in case they aborted (which isn't too easy but in most cases moving the relevant files to the final location is a good way of dealing with this problem).
This commit is contained in:
parent
cea3afd44c
commit
5f60391b63
@ -38,11 +38,15 @@ echo "Currently running $(opnsense-version) at $(date)" >> ${LOCKFILE}
|
||||
|
||||
${TEE} ${LOCKFILE} < ${PIPEFILE} &
|
||||
if opnsense-update -u > ${PIPEFILE} 2>&1; then
|
||||
/usr/local/etc/rc.syshook upgrade
|
||||
|
||||
echo '***REBOOT***' >> ${LOCKFILE}
|
||||
sleep 5
|
||||
/usr/local/etc/rc.reboot
|
||||
${TEE} ${LOCKFILE} < ${PIPEFILE} &
|
||||
if ! /usr/local/etc/rc.syshook upgrade > ${PIPEFILE} 2>&1; then
|
||||
# aboort pending upgrades
|
||||
opnsense-update -e >> ${LOCKFILE} 2>&1
|
||||
else
|
||||
echo '***REBOOT***' >> ${LOCKFILE}
|
||||
sleep 5
|
||||
/usr/local/etc/rc.reboot
|
||||
fi
|
||||
fi
|
||||
|
||||
echo '***DONE***' >> ${LOCKFILE}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user