trailofbits/ghe-backup — pull request #5 by mrowe (2014-01-19 22:07:29+00:00)
Title: Trap EXIT not SIGINT so that maintenance mode is unset on any error not ...

...just explicit signals.

Because 'set -e' is enabled, any error that occurs during the backup (e.g. in one of the ghe-* commands) causes the whole script to exit, which is good.

However, because we are only trapping explicit KILL signals, maintenance mode is not unset--which is bad. Changing the trap to EXIT means maintenance mode is always unset whether the script is killed with an explicit signal or exits because an error occurred.