From b4ac93d8d6cd8704c76523842984cec9c9cc3c70 Mon Sep 17 00:00:00 2001 From: Ralf Zerres Date: Sun, 29 Sep 2019 21:26:40 +0200 Subject: [PATCH] dsnap-sync: adopt standard snapper location hosting the configs Signed-off-by: Ralf Zerres --- find_snapper_config | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 find_snapper_config diff --git a/find_snapper_config b/find_snapper_config new file mode 100644 index 0000000..a8bf55b --- /dev/null +++ b/find_snapper_config @@ -0,0 +1,15 @@ +#!/bin/sh + +etcdirs="sysconfig default conf.d" + +for x in $etcdirs; do + d=/etc/$x/snapper + if [ -f $d ]; then + sed -i 's@^SNAPPER_CONFIG=.*@SNAPPER_CONFIG='$d'@g' bin/dsnap-sync + exit 0 + fi +done + +printf "==> Unable to find snapper configuration file in a standard location.\n" +printf "==> Using SNAPPER_CONFIG make variable.\n" +exit 1 \ No newline at end of file