X-Git-Url: http://git.treefish.org/~alex/backmeupscotty.git/blobdiff_plain/5c8e1209ef263877c5d6fa0e00386c48c0b241ea..5bfca64faf83a059b06cd63c259789989f59bc94:/backmeupscotty?ds=inline diff --git a/backmeupscotty b/backmeupscotty index be1ce20..e0689a0 100644 --- a/backmeupscotty +++ b/backmeupscotty @@ -125,16 +125,6 @@ function scottysync { done } -function deleteLock { - if ! rmdir /tmp/$(basename $0).lock; then - scottyerror "Could not delete lockfile /tmp/$(basename $0).lock!" - fi -} - -function prepare { - scottyinfo "Preparing for sync." -} - function cleanup_abort { scottyerror "Caught exit signal! Cleaning up." @@ -145,8 +135,6 @@ function cleanup_abort { kill $(jobs -p) fi - deleteLock - exit } @@ -158,11 +146,6 @@ function prepare { scottyinfo "No prepare function was defined." } -function cleanup_normal { - cleanup - deleteLock -} - function printhelp { cat </var/run/$(basename $0).pid +if ! flock -n 200; then scottyerror "Another instance of $(basename $0) is still running!" exit 1 -else - trap deleteLock EXIT fi +echo $$ 1>&200