EOF
}
+function exclusiveLock {
+ if ! mkdir /var/lock/$(basename $0); then
+ scottyerror "Another instance of $(basename $0) is still running!"
+ exit 1
+ else
+ trap deleteLock EXIT
+ fi
+}
+
function backmeupscotty {
while getopts "qn:flh" opt; do
case $opt in
exit 0
fi
+ exclusiveLock
+
if [ $BACKUP_FORCE -eq 1 ]; then
scottyinfo "Backup was enforced."
elif latestTooOld; then
exit 0
}
-
-if ! mkdir /var/lock/$(basename $0); then
- scottyerror "Another instance of $(basename $0) is still running!"
- exit 1
-else
- trap deleteLock EXIT
-fi