From a5cb2ea591ee83eeae1f758d0e1acc81ec4634d6 Mon Sep 17 00:00:00 2001 From: Jarno Rankinen Date: Tue, 16 Jul 2024 12:54:39 +0300 Subject: [PATCH] 0.2.2, Show error if --umount fails --- snapsh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/snapsh b/snapsh index 7993908..235c376 100755 --- a/snapsh +++ b/snapsh @@ -18,7 +18,7 @@ # Environment set up: -SNAPSH_VERSION='0.2.1' +SNAPSH_VERSION='0.2.2' # If config file exists, source it, otherwise use default values if [[ -e /etc/snapsh.conf ]]; then @@ -32,8 +32,8 @@ fi # (Not the one used in - exit() { if [[ "$SNAPSH_MOUNT" != "true" ]]; then - umount ${TOPLEVEL} &> /dev/null - rmdir ${TOPLEVEL} &> /dev/null + umount ${TOPLEVEL} || builtin exit 23 + rmdir ${TOPLEVEL} fi builtin exit $1 } @@ -62,7 +62,10 @@ Options: with snapsh -l --rollback NUMBER Roll back to snapshot NUMBER. See snapshot numbers with snapsh -l. Target subvolume is - detected from snapshot automatically.\n" + detected from snapshot automatically. + --mount Mount the top level subvolume to /root/btrfs-toplevel + --umount Unmount the top level subvolume + \n" } mount_check() {