# arg 1:  the new package version
post_install() {
  if getent group tt &> /dev/null ; then
    groupmod -n tt tt &> /dev/null
  else
    groupadd tt &> /dev/null
  fi

  if getent passwd tt &> /dev/null ; then
    usermod -s /bin/false -c "teamtalk server user" -d /home/tt -g tt tt &> /dev/null
  else
    useradd -m -s /bin/false -c "teamtalk server user" -d /home/tt -g tt -r tt &> /dev/null
  fi
}

# 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 tt &> /dev/null
    groupdel tt &> /dev/null || /bin/true
echo if desired, remove all teamtalk servers by deleting the teamtalk home folder located at /home/tt
}
