#!/bin/sh -e
#
#  $Id: postinst,v 1.5 2001/04/19 15:22:34 sqrt Exp $
#

POPULAR_USER_ID=110
POPULAR_GROUP_ID=110

# add 'pop' user and group unless they are already there
if ! grep -q '^pop:' /etc/passwd; then
  if ! grep -q '^pop:' /etc/group; then
    if ! addgroup --gid $POPULAR_GROUP_ID pop; then
      echo "popular .deb: Can't install group 'pop' (gid=$POPULAR_GROUP_ID)"
      exit 1
    fi
    if ! adduser --system --home /var/run/popular --no-create-home --ingroup pop --uid $POPULAR_USER_ID --gecos "POPular POP3 server" pop; then
      echo "popular .deb: Can't install user 'pop' (uid=$POPULAR_USER_ID)"
      groupdel pop
      exit 1
    fi
    chsh -s /bin/bash pop
  fi
fi
						  
chown -R pop.pop /var/log/popular
chown -R pop.pop /var/run/popular



syntax highlighted by Code2HTML, v. 0.9.1