diff options
| author | St33v <github@f3rr3t.com> | 2022-12-29 13:21:34 +1100 |
|---|---|---|
| committer | St33v <github@f3rr3t.com> | 2022-12-29 13:21:34 +1100 |
| commit | e6002bfbdec13499e6ba8b2f1f5057d36d9bdfbc (patch) | |
| tree | 89a02f4b7ba913ae55b1c16527fcbed7e2320ecd | |
| parent | b641bda213cd65cfaf4ee2c2a7e21c53026b15ff (diff) | |
| -rwxr-xr-x | borgAuto.sh | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/borgAuto.sh b/borgAuto.sh index d8e8dff..134b0b8 100755 --- a/borgAuto.sh +++ b/borgAuto.sh @@ -17,15 +17,18 @@ MOUNTPOINT=/mnt/bak # Try to mount the backup disk mountpoint -q ${MOUNTPOINT} -if [ $? -eq 1 ]; then +mpExit=$? +if [ $mpExit -eq 32 ]; then echo "Mounting backup disk to ${MOUNTPOINT}." mount -v ${MOUNTPOINT} + mountpoint -q ${MOUNTPOINT} + mpExit=$? + if [ $mpExit -ne 0 ] ; then + echo "Failed to mount backup disk (mountpoint returned $mpExit)-- exiting" + exit 1 + fi fi -if [ $? -ne 0 ]; then - echo "Failed to mount backup disk -- exiting" - exit 1 -fi # DIFF function |
