summaryrefslogtreecommitdiff
path: root/community/openntpd/openntpd.install
diff options
context:
space:
mode:
Diffstat (limited to 'community/openntpd/openntpd.install')
-rw-r--r--community/openntpd/openntpd.install25
1 files changed, 16 insertions, 9 deletions
diff --git a/community/openntpd/openntpd.install b/community/openntpd/openntpd.install
index 99223f355..42063ef21 100644
--- a/community/openntpd/openntpd.install
+++ b/community/openntpd/openntpd.install
@@ -1,17 +1,24 @@
-post_install() {
- if [ ! "`grep ^ntp /etc/group`" ]; then
- echo "adding new group: ntp"
- /usr/sbin/groupadd -g 87 ntp
+createuser() {
+ if ! getent group ntp >/dev/null; then
+ groupadd -g 87 ntp
fi
-
- if [ ! "`grep ^ntp /etc/passwd`" ]; then
- echo "adding new user: ntp"
- /usr/sbin/useradd -g ntp -u 87 -d /var/empty -s /bin/false -c 'Network Time Protocol' ntp
+
+ 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() {
- post_install $1
+ createuser
+}
+
+post_remove() {
+ userdel ntp >/dev/null
}
# vim: ts=2 sw=2 et ft=sh