File: systemd-container.postinst

package info (click to toggle)
systemd 232-25+deb9u11
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 46,164 kB
  • sloc: ansic: 290,592; xml: 49,217; makefile: 5,503; sh: 4,031; python: 2,596; perl: 1,838
file content (21 lines) | stat: -rw-r--r-- 842 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

set -e
machine_policy=/etc/dbus-1/system.d/org.freedesktop.machine1.conf
if [ "$1" = configure ] && [ -z "$2" ] && [ -f ${machine_policy}.dpkg-bak ] ; then
    md5sum="$(md5sum ${machine_policy} | sed -e 's/ .*//')"
    old_md5sum="$(dpkg-query -W -f='${Conffiles}' systemd-container | \
                        sed -n -e "\' ${machine_policy} ' { s/ obsolete$//; s/.* //; p }")"
    # On new installs, if the policy file was preserved on systemd upgrade
    # by dpkg-maintscript helper, copy it back if the new file has not been modified yet
    if [ "$md5sum" = "$old_md5sum" ] ; then
        mv ${machine_policy}.dpkg-bak ${machine_policy}
    fi
fi

# Enable machines.target by default on new installs and upgrades
if dpkg --compare-versions "$2" lt "232-4~"; then
    systemctl enable machines.target || true
fi

#DEBHELPER#