diff options
author | Magnus Ottenklinger <evnu@posteo.de> | 2015-10-14 22:08:32 +0200 |
---|---|---|
committer | Magnus Ottenklinger <evnu@posteo.de> | 2015-10-14 22:25:11 +0200 |
commit | 3624fa82895ac7bbe0221fbf32bf72cdb16c68ec (patch) | |
tree | 8a9e3940baf24d8e7b7a89d3ca0c05c34cd5473f | |
parent | 5169fbe145e06ef28d59a80310d3bdb69e80d4ba (diff) | |
download | unionfs-fuse-git-3624fa82895ac7bbe0221fbf32bf72cdb16c68ec.tar.gz |
use a cleanup function in test.sh
-rwxr-xr-x | test.sh | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -9,8 +9,14 @@ echo v1 > original/file echo v1 > original/play-with-me echo v1 > original/delete-me +cleanup() { + if [ -e "union" ]; then fusermount -u -q union; fi + rm -rf union original working-copy +} +trap cleanup EXIT + src/unionfs -d -o cow working-copy=rw:original=ro union >unionfs.log 2>&1 & -trap 'if [ "$(ls union)" ]; then fusermount -u union; fi; rm -rf union original working-copy' EXIT + sleep 1 [ "$(cat union/file)" = "v1" ] |