#!/bin/bash set -e # RPM scenarios # install upgrade uninstall # %pre $1 == 1 $1 == 2 (N/A) # %post $1 == 1 $1 == 2 (N/A) # %preun (N/A) $1 == 1 $1 == 0 # %postun (N/A) $1 == 1 $1 == 0 ARG= # In case of RPM based ditros. Map installation flags with Deb if [ "$1" = "0" ]; then ARG="remove" elif [ "$1" = "1" ]; then ARG="upgrade" else ARG=$1 fi if [ "$ARG" = "remove" ] || [ "$ARG" = "purge" ]; then rm -f /var/run/mde_netfilter.sock if [ -e /etc/os-release ]; then if [ -f /usr/lib/systemd/system/mde_netfilter.service ]; then # RPM based distros systemctl disable mde_netfilter.service systemctl disable mde_netfilter.socket rm -f /usr/lib/systemd/system/mde_netfilter.* elif [ -f /lib/systemd/system/mde_netfilter.service ]; then # DEB based distros systemctl disable mde_netfilter.service systemctl disable mde_netfilter.socket rm -f /lib/systemd/system/mde_netfilter.* fi systemctl daemon-reload fi fi exit 0