I'm hoping to trap the exit codes so that I can pull off something like:
Code: Select all
(misc tasks to prepare for re-imaging)
fsarchiver restfs -j3 -v /mnt/external/current.fsa id=0,dest=/dev/sda2
if exitcode = 0 then print "success"
if exitcode = 1 then print "archive file not found; restore unsuccessful"
if exitcode = 2 then print "archive file has errors; restore unsuccessful"
if exitcode = 3 then print "destination invalid; remove your USB thumb drive and reboot"
if exitcode = 4 then print "destination too small for archive / out of space"
For my specific application, the end user wouldn't necessarily be able to resolve those errors on their own (such as a corrupt image file). But being able to show them would greatly improve feedback when they call the helpdesk.