#!/bin/sh
set -e

case "$1" in
  install)
    if ! getent group flarm >/dev/null; then
      addgroup --quiet --system flarm
    fi

    if ! getent passwd flarm >/dev/null; then
      adduser --system --ingroup flarm --home /var/spool/flarm \
        --gecos "Flarmradar User" --shell /bin/sh flarm
      usermod -a -G tty,dialout flarm
    fi
    ;;

    upgrade|abort-upgrade)
        ;;

    *)
        echo "preinst called with unknown argument \`$1'" >&2
        exit 0
        ;;
esac


exit 0
