summaryrefslogtreecommitdiff
path: root/extra/ntp/install
diff options
context:
space:
mode:
Diffstat (limited to 'extra/ntp/install')
-rw-r--r--extra/ntp/install15
1 files changed, 15 insertions, 0 deletions
diff --git a/extra/ntp/install b/extra/ntp/install
index 926b4126e..7581ec12f 100644
--- a/extra/ntp/install
+++ b/extra/ntp/install
@@ -1,3 +1,9 @@
+post_install() {
+ getent group ntp &>/dev/null || groupadd -g 87 ntp >/dev/null
+ getent passwd ntp &>/dev/null || useradd -u 87 -g ntp -d /var/lib/ntp -c 'Network Time Protocol' -s /bin/false ntp >/dev/null
+ true
+}
+
post_upgrade() {
if [[ $(vercmp $2 4.2.6.p3) -le 0 ]]; then
cat <<EOF
@@ -16,4 +22,13 @@ EOF
EOF
fi
+ if [[ $(vercmp $2 4.2.6.p5-3) -le 0 ]]; then
+ post_install
+ fi
+}
+
+post_remove() {
+ getent passwd ntp &>/dev/null && userdel ntp >/dev/null
+ getent group ntp &>/dev/null && groupdel ntp >/dev/null
+ true
}