| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
. /usr/share/debconf/confmodule |
| 6 |
|
| 7 |
upgrade () { |
| 8 |
if [ ! -z "$2" ] && dpkg --compare-versions "$2" le "1:3.0.2-1~exp+3"; then |
| 9 |
db_get lxc/auto_update_config |
| 10 |
res="$RET" |
| 11 |
if [ "$res" = "true" ]; then |
| 12 |
lxc-update-config -c /etc/lxc/default.conf |
| 13 |
find /var/lib/lxc -maxdepth 2 -iname "config" -exec /usr/bin/lxc-update-config -c {} \; |
| 14 |
fi |
| 15 |
fi |
| 16 |
|
| 17 |
if [ -z "$2" ] || dpkg --compare-versions "$2" le "1:3.1.0+really3.0.3-2"; then |
| 18 |
if command -v apparmor_parser > /dev/null && [ -e /etc/apparmor.d/lxc-containers ]; then |
| 19 |
apparmor_parser -r -W -T /etc/apparmor.d/lxc-containers || \ |
| 20 |
echo "Failed to run 'apparmor_parser -rWT /etc/apparmor.d/lxc-containers'. You will probably need to run it by hand at some point." |
| 21 |
fi |
| 22 |
fi |
| 23 |
} |
| 24 |
|
| 25 |
case "$1" in |
| 26 |
configure) |
| 27 |
upgrade "$@" |
| 28 |
;; |
| 29 |
|
| 30 |
abort-upgrade|abort-remove|abort-deconfigure) |
| 31 |
;; |
| 32 |
|
| 33 |
*) |
| 34 |
echo "postinst called with unknown argument \`$1'" >&2 |
| 35 |
exit 1 |
| 36 |
;; |
| 37 |
esac |
| 38 |
|
| 39 |
#DEBHELPER# |
| 40 |
|
| 41 |
db_stop |
| 42 |
exit 0 |