| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
case "$1" in |
| 6 |
purge) |
| 7 |
# By debian Policy ยง6.5, we may only rely on essential packages and |
| 8 |
# must fail gracefully if they are unavailable. |
| 9 |
# Use userdel/groupdel from passwd instead of deluser/delgroup from |
| 10 |
# the adduser package. This is because adduser depends on passwd, |
| 11 |
# but is of lesser priority. |
| 12 |
# Note that at the time of this writing, neither passwd nor adduser |
| 13 |
# are essential packages. |
| 14 |
userdel _iked >/dev/null 2>&1 || true; |
| 15 |
groupdel _iked >/dev/null 2>&1 || true; |
| 16 |
# The following files get left behind unless we manually delete them: |
| 17 |
# /etc/iked/ |
| 18 |
# /etc/iked/local.pub |
| 19 |
# /etc/iked/private/ |
| 20 |
# /etc/iked/private/local.key |
| 21 |
# The user may have created other files under these directories. |
| 22 |
# As a result, we only attempt to delete the files that we know |
| 23 |
# openiked created. |
| 24 |
rm /etc/iked/private/local.key || true |
| 25 |
rmdir /etc/iked/private || true |
| 26 |
rm /etc/iked/local.pub || true |
| 27 |
rmdir /etc/iked || true |
| 28 |
;; |
| 29 |
|
| 30 |
remove|failed-upgrade|abort-install|abort-upgrade|disappear|upgrade) |
| 31 |
;; |
| 32 |
|
| 33 |
*) |
| 34 |
echo "postrm called with unknown argument \`$1'" >&2 |
| 35 |
exit 1 |
| 36 |
;; |
| 37 |
esac |
| 38 |
|
| 39 |
#DEBHELPER# |