0.2.2, Show error if --umount fails

This commit is contained in:
Jarno Rankinen 2024-07-16 12:54:39 +03:00
parent 24bba58aa9
commit a5cb2ea591
1 changed files with 7 additions and 4 deletions

11
snapsh
View File

@ -18,7 +18,7 @@
# Environment set up: # Environment set up:
SNAPSH_VERSION='0.2.1' SNAPSH_VERSION='0.2.2'
# If config file exists, source it, otherwise use default values # If config file exists, source it, otherwise use default values
if [[ -e /etc/snapsh.conf ]]; then if [[ -e /etc/snapsh.conf ]]; then
@ -32,8 +32,8 @@ fi # (Not the one used in -
exit() { exit() {
if [[ "$SNAPSH_MOUNT" != "true" ]]; then if [[ "$SNAPSH_MOUNT" != "true" ]]; then
umount ${TOPLEVEL} &> /dev/null umount ${TOPLEVEL} || builtin exit 23
rmdir ${TOPLEVEL} &> /dev/null rmdir ${TOPLEVEL}
fi fi
builtin exit $1 builtin exit $1
} }
@ -62,7 +62,10 @@ Options:
with snapsh -l with snapsh -l
--rollback NUMBER Roll back to snapshot NUMBER. See snapshot --rollback NUMBER Roll back to snapshot NUMBER. See snapshot
numbers with snapsh -l. Target subvolume is 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() { mount_check() {