summaryrefslogtreecommitdiff
path: root/community/openntpd/openntpd.install
blob: 42063ef216821c4ad522622eb98d0ac2374f58e1 (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
createuser() {
  if ! getent group ntp >/dev/null; then
    groupadd -g 87 ntp
  fi

  if ! getent passwd ntp >/dev/null; then
    useradd -g ntp -u 87 -d /var/empty -s /bin/false -c 'Network Time Protocol' ntp
  fi
}

post_install() {
  createuser
  systemd-tmpfiles --create /usr/lib/tmpfiles.d/openntpd.conf
}

post_upgrade() {
  createuser
}

post_remove() {
  userdel ntp >/dev/null
}

# vim: ts=2 sw=2 et ft=sh