#!/bin/sh
if [ "$1" = "configure" ]; then
  if ! getent group zorp >/dev/null 2>&1; then
    addgroup --quiet --system zorp
  fi

  if ! getent passwd zorp >/dev/null 2>&1; then
    adduser --quiet --system --no-create-home --home /var/lib/zorp --ingroup zorp zorp
  fi

  if ! getent group zorp >/dev/null 2>&1| grep -q -E "[:,]zorp,|[:,]zorp$"; then
    adduser --quiet zorp zorp
  fi

  chown -R root:zorp /etc/zorp
  chmod 0750 /etc/zorp

  mkdir -p /var/run/zorp || /bin/true
  chown -R root.zorp /var/run/zorp
  chmod 0770 /var/run/zorp

fi

#DEBHELPER#
