dragonfly/tools/packaging/debian/dragonfly.postrm
Boaz Sade 57e3ec9a81
feat(build): debian package building (#689)
Signed-off-by: Boaz Sade <boaz@dragonflydb.io>
2023-01-16 17:44:53 +02:00

18 lines
414 B
Bash
Executable file

#!/bin/sh
# Script to run at the end of remove
set -eu
DIR_NAME="dragonfly"
USER_NAME="dfly"
CONFFILE="/etc/${DIR_NAME}/${DIR_NAME}.conf"
# When purging the package, remove all trances
if [ "${1}" = "purge" ]
then
userdel ${USER_NAME} || true
rm -rf /var/lib/${DIR_NAME} /var/log/${DIR_NAME} /etc/${DIR_NAME} /var/run/${DIR_NAME}
dpkg-statoverride --remove ${CONFFILE} || test $? -eq 2
fi
#DEBHELPER#
exit 0