summaryrefslogtreecommitdiff
path: root/community/openntpd/openntpd.install
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-06-11 00:02:18 +0000
committerroot <root@rshg054.dnsready.net>2012-06-11 00:02:18 +0000
commit4714cec7e8367a7618b168d0db4bc085dbfaac8a (patch)
treeb1f3049ee78988b0db6ec69637a1ee37c8b63b3f /community/openntpd/openntpd.install
parent7b2739f21a7ed0d52497fa381c9a2383e71ab7a8 (diff)
Mon Jun 11 00:02:18 UTC 2012
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