X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=ossec-hids.git;a=blobdiff_plain;f=debian%2Fpostrm;fp=debian%2Fpostrm;h=cc661bc5e832e79eb9896b48bebd256ff0bda866;hp=3f3c4d9ae8467fb9b5d1dc15f524f3018cec1763;hb=b71bebed41caaa112ba103173ad614378d66a9e8;hpb=7faf709324cb60862a3db68990f3a275edcec184 diff --git a/debian/postrm b/debian/postrm index 3f3c4d9..cc661bc 100644 --- a/debian/postrm +++ b/debian/postrm @@ -19,6 +19,33 @@ esac # cleanup leftovers rm -rf /var/ossec/etc /var/ossec/queue /var/ossec/stats + +# chown ossec mail directory back to root +chown -Rh root:root /var/ossec + +# users and group names +OSSEC_USER="ossec" +OSSEC_USER_MAIL="ossecm" +OSSEC_USER_EXEC="ossece" +OSSEC_USER_REM="ossecr" +OSSEC_GROUP="ossec" + +# delete users/groups +if getent passwd $OSSEC_USER >/dev/null; then + deluser $OSSEC_USER +fi +if getent passwd $OSSEC_USER_MAIL >/dev/null; then + deluser $OSSEC_USER_MAIL +fi +if getent passwd $OSSEC_USER_EXEC >/dev/null; then + deluser $OSSEC_USER_EXEC +fi +if getent passwd $OSSEC_USER_REM >/dev/null; then + deluser $OSSEC_USER_REM +fi +if getent group $OSSEC_GROUP >/dev/null; then + delgroup --quiet $OSSEC_GROUP +fi # update system v init links update-rc.d -f ossec-hids remove