File: borgmatic.postinst

package info (click to toggle)
borgmatic 2.0.11-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,752 kB
  • sloc: python: 58,506; sh: 150; makefile: 8; javascript: 5
file content (17 lines) | stat: -rw-r--r-- 588 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

set -e

# Upstream provides a config file migration tool, so let's save the
# user time by running it.  Notably, it highlights deprecated config
# keys and introduces their replacements in a commented-out state.
if [ "$1" = "configure" ]; then
    if find /etc/borgmatic -maxdepth 1 -type f -name "*.yaml" -print -quit | grep -q .; then
        for i in /etc/borgmatic/*.yaml; do
            borgmatic config generate --source "$i" --destination "$i.dpkg-dist" \
                      || echo "WARNING: Failed to migrate $i to $i.dpkg-dist"
        done
    fi
fi

#DEBHELPER#