summarylogtreecommitdiffstats
path: root/teamtalk.install
blob: 2bb98cd5ea7c81d2fe5b577aa91dbc8742def00e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# arg 1:  the new package version
post_install() {
  # Make sure the group and user "teamtalk" exists on this system and have the correct values
  if getent group teamtalk &> /dev/null ; then
    groupmod -g 885 -n teamtalk teamtalk &> /dev/null
  else
    groupadd -g 885 teamtalk &> /dev/null
  fi

  if getent passwd teamtalk &> /dev/null ; then
    usermod -s /bin/false -c "teamtalk server user" -d /var/lib/tt5srv -u 885 -g teamtalk teamtalk &> /dev/null
  else
    useradd -m -s /bin/false -c "teamtalk server user" -d /var/lib/tt5srv -u 885 -g teamtalk -r teamtalk &> /dev/null
  fi
  # create the logs folder
  install -do885 -g885 -m0755 /var/log/teamtalk
  # create the config folder
  install -do885 -g885 -m0755 /etc/teamtalk
}

# 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 teamtalk &> /dev/null
    groupdel teamtalk &> /dev/null || /bin/true
    rm -rf /var/log/teamtalk/ /etc/teamtalk/ &> /dev/null || /bin/true
}