Files
dsnap-sync/find_snapper_config
Toshifumi NISHINAGA a00326e28a Fix inappropriate regexp
This regexp replaces not only SNAPPER_CONFIG but also SNAPPER_CONFIG_DIR
to SNAPPER_CONFIG.

> 's@^SNAPPER_CONFIG.*@SNAPPER_CONFIG='$d'@g'

I change this regexp to fix SNAPPER_CONFIG_DIR will become not undefined.
2018-03-30 03:45:45 +09:00

16 lines
356 B
Bash
Executable File

#!/bin/bash
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/snap-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