]> git.treefish.org Git - backmeupscotty.git/blobdiff - backmeupscotty-example
Using only one cleanup function with abort switch.
[backmeupscotty.git] / backmeupscotty-example
index 44d97cd4be88c38c3b634a5f1c57805c675af186..a028abecbc325a219670e6fcc1bd43cb78a2fb6f 100755 (executable)
@@ -12,14 +12,11 @@ SYNC_EXC="/gack,/gugu/*"
 
 function prepare {
     echo "prepare"
+    sleep 5
 }
 
-function cleanup_normal {
-    echo "cleanup"
-}
-
-function cleanup_abort {
-    echo "cleanup_abort"
+function cleanup {
+    [ -z "$1" ] && echo "normal cleanup" || echo "abort cleanup"
 }
 
 backmeupscotty $@