You can use `set -e` to get the shell script to abort on errors.  This makes the script more robust since it avoids running into undefined states and also obsoletes the `|| exit 1` statements below.