summaryrefslogtreecommitdiff
path: root/community/pdnsd/pdnsd.install
diff options
context:
space:
mode:
Diffstat (limited to 'community/pdnsd/pdnsd.install')
-rw-r--r--community/pdnsd/pdnsd.install22
1 files changed, 22 insertions, 0 deletions
diff --git a/community/pdnsd/pdnsd.install b/community/pdnsd/pdnsd.install
new file mode 100644
index 000000000..c1c10f044
--- /dev/null
+++ b/community/pdnsd/pdnsd.install
@@ -0,0 +1,22 @@
+post_install() {
+ getent group pdnsd &>/dev/null || groupadd -g 184 pdnsd >/dev/null
+ getent passwd pdnsd &>/dev/null || useradd -u 184 -g pdnsd -d /var/lib/pdnsd -c 'Proxy DNS server' -s /bin/nologin pdnsd >/dev/null
+ true
+}
+
+post_upgrade() {
+ if [[ $(vercmp $2 1.2.9.a-5) -le 0 ]]; then
+ # in case the user/group were already created as recommended by the wiki
+ userdel pdnsd &>/dev/null
+ groupdel pdnsd &>/dev/null
+
+ post_install
+ chown -R 184:184 /var/cache/pdnsd
+ fi
+}
+
+post_remove() {
+ getent passwd pdnsd &>/dev/null && userdel pdnsd >/dev/null
+ getent group pdnsd &>/dev/null && groupdel pdnsd >/dev/null
+ true
+}