#!/bin/sh # postremove - runs after files are removed. # Debian actions: remove | purge | upgrade | failed-upgrade | abort-install | # abort-upgrade | disappear set -e APP_DIR=/opt/etherpad case "$1" in remove) [ -L "${APP_DIR}/settings.json" ] && rm -f "${APP_DIR}/settings.json" || true [ -L "${APP_DIR}/var" ] && rm -f "${APP_DIR}/var" || true [ -L "${APP_DIR}/src/plugin_packages" ] && rm -f "${APP_DIR}/src/plugin_packages" || true if [ -d /run/systemd/system ] && command -v systemctl >/dev/null 2>&1; then # Disable so the wants/ symlink doesn't dangle after the unit # file is removed by dpkg. systemctl disable etherpad.service >/dev/null 2>&1 || true systemctl daemon-reload || true fi ;; purge) rm -rf /etc/etherpad rm -rf /var/lib/etherpad rm -rf /var/log/etherpad if getent passwd etherpad >/dev/null 2>&1; then deluser --system etherpad >/dev/null 2>&1 || true fi if getent group etherpad >/dev/null 2>&1; then delgroup --system etherpad >/dev/null 2>&1 || true fi if [ -d /run/systemd/system ] && command -v systemctl >/dev/null 2>&1; then systemctl daemon-reload || true fi ;; upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; *) echo "postremove called with unknown argument: $1" >&2 exit 1 ;; esac exit 0