# arg 1: the new package version post_install() { if [ -z "`grep '^postgrey::' /etc/group`" ]; then groupadd -g 314 postgrey >& /dev/null fi if [ -z "`grep '^postgrey:' /etc/passwd`" ]; then useradd -u 314 -d /var/spool/postfix/postgrey -g postgrey -s /bin/false postgrey else # (postgrey should have no shell, but may have been added by others in the past) usermod -s /bin/false postgrey fi chown postgrey:postgrey /var/spool/postfix/postgrey } # arg 1: the new package version # arg 2: the old package version post_upgrade() { post_install $1 } # arg 1: the old package version pre_remove() { userdel postgrey &> /dev/null groupdel postgrey &> /dev/null } op=$1 shift $op $*