58 lines
1.4 KiB
Bash
58 lines
1.4 KiB
Bash
#!/bin/sh
|
|
# postrm script for linux-hello-daemon
|
|
#
|
|
# see: dh_installdeb(1)
|
|
|
|
set -e
|
|
|
|
case "$1" in
|
|
purge)
|
|
# Remove state directory and all templates
|
|
if [ -d /var/lib/linux-hello ]; then
|
|
echo "Removing /var/lib/linux-hello..."
|
|
rm -rf /var/lib/linux-hello
|
|
fi
|
|
|
|
# Remove runtime directory
|
|
if [ -d /run/linux-hello ]; then
|
|
rm -rf /run/linux-hello
|
|
fi
|
|
|
|
# Remove configuration directory
|
|
if [ -d /etc/linux-hello ]; then
|
|
echo "Removing /etc/linux-hello..."
|
|
rm -rf /etc/linux-hello
|
|
fi
|
|
|
|
# Remove linux-hello system user
|
|
if getent passwd linux-hello > /dev/null 2>&1; then
|
|
echo "Removing linux-hello system user..."
|
|
deluser --system linux-hello 2>/dev/null || true
|
|
fi
|
|
|
|
# Remove linux-hello group if it exists and has no members
|
|
if getent group linux-hello > /dev/null 2>&1; then
|
|
delgroup --system linux-hello 2>/dev/null || true
|
|
fi
|
|
;;
|
|
|
|
remove)
|
|
# Remove runtime directory on remove (not purge)
|
|
if [ -d /run/linux-hello ]; then
|
|
rm -rf /run/linux-hello
|
|
fi
|
|
;;
|
|
|
|
upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
|
;;
|
|
|
|
*)
|
|
echo "postrm called with unknown argument \`$1'" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
#DEBHELPER#
|
|
|
|
exit 0
|