diff options
author | P. J. McDermott <pj@pehjota.net> | 2015-11-06 00:37:56 (EST) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2015-11-06 00:37:56 (EST) |
commit | 37ec7327dbd692a6969bcc556c0f3758ad3dda91 (patch) | |
tree | 2993edd676d57aa670b5fbc1e28ea7b9df520a6b | |
parent | 41f764da19048fc2e9ec583c37de73de915811d2 (diff) | |
download | firman.sh-37ec7327dbd692a6969bcc556c0f3758ad3dda91.zip firman.sh-37ec7327dbd692a6969bcc556c0f3758ad3dda91.tar.gz firman.sh-37ec7327dbd692a6969bcc556c0f3758ad3dda91.tar.bz2 |
do_update(): Fix error handling
What idiot messed up this return logic?
-rw-r--r-- | src/action/update.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/action/update.sh b/src/action/update.sh index 477300f..b0e228d 100644 --- a/src/action/update.sh +++ b/src/action/update.sh @@ -130,9 +130,7 @@ do_update() # Write the ROM to flash. info 'Installing new firmware...' - if flashrom_write "$(board_get_chip)"; then - info 'Firmware installation complete' - sleep 5 + if ! flashrom_write "$(board_get_chip)"; then rm_temp 'rom' return 1 fi @@ -140,5 +138,8 @@ do_update() # Clean up the ROM. rm_temp 'rom' + info 'Firmware installation complete' + sleep 5 + return 0 } |