summaryrefslogtreecommitdiff
path: root/community/darkstat/darkstat.install
blob: 246bfd80870d4efa7921f72ff90d2eac4a6ccb30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
daemon_name=darkstat
daemon_chroot=var/darkstat

post_install() {
  if [ ! -d "$daemon_chroot" ]; then
    install -d "$daemon_chroot"
    touch "$daemon_chroot/darkstat.dat"
  fi
  useradd \
    --system \
    --home /"$daemon_chroot" \
    --shell /bin/false \
    --no-user-group \
    --gid nobody "$daemon_name"
  chown -R "$daemon_name":nobody "/$daemon_chroot"
}

post_remove() {
  userdel "$daemon_name"
}