diff --git a/Makefile b/Makefile index cb2bd98..bfe9813 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,6 @@ SYSTEMD_DIR = $(DESTDIR)$(PREFIX)/lib/systemd/system .PHONY: install install: - @./find_snapper_config || sed -i 's@^SNAPPER_CONFIG.*@SNAPPER_CONFIG='$(SNAPPER_CONFIG)'@g' bin/$(PKGNAME) + @./find_snapper_config || sed -i 's@^SNAPPER_CONFIG=.*@SNAPPER_CONFIG='$(SNAPPER_CONFIG)'@g' bin/$(PKGNAME) @install -Dm755 bin/* -t $(BIN_DIR)/ - @install -Dm644 ./$(SNAPPER_TEMPLATES)/* -t $(SNAPPER_TEMPLATES)/ + @install -Dm644 ./$(SNAPPER_TEMPLATES)/* -t $(DESTDIR)/$(SNAPPER_TEMPLATES)/ diff --git a/bin/snap-sync b/bin/snap-sync index 7752e36..8c160b9 100755 --- a/bin/snap-sync +++ b/bin/snap-sync @@ -886,12 +886,12 @@ run_finalize () { if [ "$verbose" ]; then printf "Tagging snapper metadata on target for configuration '%s' ...\n" "$selected_config" fi - i=1 - i_max=20 + ii=1 + ii_max=20 cmd="snapper --verbose --config \"$snapper_target_config\" list --type single | awk '/'\"$snap_description_running\"'/' | awk -F '|' '\$1 == "$snapper_new_id" {print \$1}'" # !!! ugly hack !!!: wait for snapper to list target snapshot in database. how to trigger database resync? # it is not deterministic, when the entry in the listing will show up .... for now, wait max 10 min ... - while [ "$i" -le "$i_max" ]; do + while [ "$ii" -le "$ii_max" ]; do if [ -n "$remote" ]; then ret=$($ssh $cmd) else @@ -911,10 +911,10 @@ run_finalize () { fi fi if [ "$verbose" ]; then - printf "Waiting for snappers database update on target %s/%s ...\n" "$i" "$max" + printf "Waiting for snappers database update on target %s/%s ...\n" "$ii" "$ii_max" fi sleep 30 - i=$(($i + 1)) + ii=$(($ii + 1)) done else cmd="snapper --verbose --config $selected_config modify --description $snap_description_synced --userdata $userdata $snapper_new_id" diff --git a/find_snapper_config b/find_snapper_config index a04fae3..ee78db7 100755 --- a/find_snapper_config +++ b/find_snapper_config @@ -5,7 +5,7 @@ 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 + sed -i 's@^SNAPPER_CONFIG=.*@SNAPPER_CONFIG='$d'@g' bin/snap-sync exit 0 fi done