From 72a1198e50fd41ad9c64e8bdae158a38a77612c6 Mon Sep 17 00:00:00 2001 From: Michael Scalzetti Date: Sun, 27 Mar 2022 20:10:03 -0400 Subject: [PATCH] allowed for 'issue handling' which is the same as my error handling but doesn't quit the program. Allows for there to be non-fatal issues without the program quitting --- run.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/run.sh b/run.sh index 5a36d86..9c57a9c 100755 --- a/run.sh +++ b/run.sh @@ -3,10 +3,14 @@ MOUNT_NAME=priv MOUNT_DIR=/media/michael/priv error(){ - echo $1 + echo "!\t$1" exit 1 } +issue(){ + echo "!\t$1" +} + clear @@ -29,19 +33,19 @@ ln -s "$MOUNT_DIR/notes" ./data.link ||\ echo "Starting container..." -docker run --name priv --rm -it -v `pwd`/data.link/:/notes `docker build -q .` ||\ - error "Issue making docker container... quitting..." +docker run --name priv --rm -it -v `pwd`/data.link/:/notes `docker build -q .` echo "Unmounting db..." -umount -f "$MOUNT_DIR" &&\ +umount -f "$MOUNT_DIR" ||\ + issue "Issue unmounting $DEV_USB..." rm -rf $MOUNT_DIR ||\ - error "Issue unmounting and deleting mountpoint... quitting..." + issue "Issue deleting mountpoint..." echo "Removing link..." rm -rf ./data.link - error "Issue deleting link... quitting..." + issue "Issue deleting link..." echo "Locking db..."