| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
Remove () |
| 6 |
{ |
| 7 |
DEFAULT="${1}" |
| 8 |
|
| 9 |
if [ -h "${DEFAULT}" ] |
| 10 |
then |
| 11 |
TARGET="$(readlink -f ${DEFAULT})" |
| 12 |
else |
| 13 |
TARGET="" |
| 14 |
fi |
| 15 |
|
| 16 |
for ITEM in ${DEFAULT} ${TARGET} |
| 17 |
do |
| 18 |
if dpkg-statoverride --list "${ITEM}" > /dev/null 2>&1 |
| 19 |
then |
| 20 |
dpkg-statoverride --quiet --remove "${ITEM}" |
| 21 |
fi |
| 22 |
|
| 23 |
rmdir --ignore-fail-on-non-empty --parents ${ITEM} > /dev/null 2>&1 || true |
| 24 |
|
| 25 |
rm -f ${ITEM} > /dev/null 2>&1 || true |
| 26 |
rmdir --ignore-fail-on-non-empty --parents $(dirname ${ITEM}) > /dev/null 2>&1 || true |
| 27 |
done |
| 28 |
} |
| 29 |
|
| 30 |
case "${1}" in |
| 31 |
remove) |
| 32 |
Remove /var/cache/container |
| 33 |
Remove /etc/compute-tools/debconf |
| 34 |
Remove /etc/compute-tools/config |
| 35 |
Remove /etc/compute-tools/hooks |
| 36 |
Remove /etc/compute-tools/keys |
| 37 |
Remove /etc/needrestart/restart.d |
| 38 |
Remove /var/lib/machines |
| 39 |
;; |
| 40 |
|
| 41 |
purge) |
| 42 |
rm -f /etc/compute-tools/container.conf |
| 43 |
;; |
| 44 |
|
| 45 |
upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) |
| 46 |
|
| 47 |
;; |
| 48 |
|
| 49 |
*) |
| 50 |
echo "postrm called with unknown argument \`${1}'" >&2 |
| 51 |
exit 1 |
| 52 |
;; |
| 53 |
esac |
| 54 |
|
| 55 |
#DEBHELPER# |
| 56 |
|
| 57 |
exit 0 |