From ea2d11c48b57c6a888fcba516a10f1a7ca1a578e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Sch=C3=A4fer?= Date: Mon, 26 Feb 2024 10:04:14 +0100 Subject: [PATCH] update lockfile --- bashclub-zfs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bashclub-zfs b/bashclub-zfs index c6aed3a..56a50f0 100644 --- a/bashclub-zfs +++ b/bashclub-zfs @@ -2,6 +2,15 @@ # backup-zfs: use zfs send/recv to push/pull snapshots - New does not run twice prog="$(basename "$0")" +lockfilecheck="${!#}" + +# Überprüfen, ob die Variable ".lock" enthält +if [[ $lockfilecheck = *'.lock' ]]; then + custom_lockfile="${lockfilecheck}" +else + custom_lockfile="bashclub-zfs.lock" +fi + usage() { cat >&2 <<-EOF usage: $prog [-hvq] [-t tag] [-k keep] [-d dateopts] src dest @@ -281,4 +290,4 @@ ZFS() { ZFS "$srchost" destroy -r $srcfs@$snap done -) 9>/var/lock/bashclub-zfs.lock +) 9>/var/lock/$custom_lockfile \ No newline at end of file