From 3624fa82895ac7bbe0221fbf32bf72cdb16c68ec Mon Sep 17 00:00:00 2001 From: Magnus Ottenklinger Date: Wed, 14 Oct 2015 22:08:32 +0200 Subject: use a cleanup function in test.sh --- test.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test.sh b/test.sh index e1248be..21acf09 100755 --- a/test.sh +++ b/test.sh @@ -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" ] -- cgit v1.2.1