# arg 1:  the new package version
post_install() {
  # /etc/fetchmail must be owned by fetchmail for daemon to work.
  echo "If you run fetchmail as a daemon and not a cron job"
  echo "then 'chown fetchmail /etc/fetchmailrc'"
  # the su in /etc/rc.d/fetchmail wont work without a shell.
  getent passwd fetchmail >/dev/null || usr/sbin/useradd -u 90 -g nobody \
      -d '/var/run/fetchmail' -c 'Fetchmail daemon' -s /bin/bash fetchmail
}

# 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() {
  usr/sbin/userdel fetchmail &>/dev/null
}

op=$1
shift

$op $*
