#!/bin/bash
#
# Re-enables the backup2l lock file introduced in 1.6 as we've just run
#  backup2l a second time (as a dry-run) to determine the amount of disk
#  space we're likely to use for the next backup.
#

# Determine the location of the lock file from the default config.
LOCK="$(grep '^BACKUP_DIR=\|^VOLNAME=' /etc/backup2l.conf | sed 's|.*="||' | tr -d '\n' | sed -e 's|"|/|1' -e 's|"||').lock"

# If it exists, then move it back where it came from.
if [ -f ${LOCK}_disabled ]; then
  mv -f ${LOCK}_disabled ${LOCK}
fi
