Debian Codegraph @

debian/borgmatic.postinst

raw
1 #!/bin/sh
2
3 set -e
4
5 # Upstream provides a config file migration tool, so let's save the
6 # user time by running it. Notably, it highlights deprecated config
7 # keys and introduces their replacements in a commented-out state.
8 if [ "$1" = "configure" ]; then
9 if find /etc/borgmatic -maxdepth 1 -type f -name "*.yaml" -print -quit | grep -q .; then
10 for i in /etc/borgmatic/*.yaml; do
11 borgmatic config generate --source "$i" --destination "$i.dpkg-dist" \
12 || echo "WARNING: Failed to migrate $i to $i.dpkg-dist"
13 done
14 fi
15 fi
16
17 #DEBHELPER#