summarylogtreecommitdiffstats
path: root/powerdns-admin.install
diff options
context:
space:
mode:
authorSergey Shatunov2016-11-03 19:29:49 +0700
committerSergey Shatunov2016-11-03 19:29:49 +0700
commite3e530c6c9964ddfecf1e2e7a9d1d86efa3f7cbb (patch)
tree26882f70ee27ea266019e5016ff65cdf1c0fd102 /powerdns-admin.install
downloadaur-e3e530c6c9964ddfecf1e2e7a9d1d86efa3f7cbb.tar.gz
Initial commit
Diffstat (limited to 'powerdns-admin.install')
-rw-r--r--powerdns-admin.install24
1 files changed, 24 insertions, 0 deletions
diff --git a/powerdns-admin.install b/powerdns-admin.install
new file mode 100644
index 00000000000..8373cc0aeee
--- /dev/null
+++ b/powerdns-admin.install
@@ -0,0 +1,24 @@
+post_install() {
+ if ! getent group powerdns-admin >/dev/null; then
+ groupadd -g 980 --system powerdns-admin
+ fi
+ if ! getent passwd powerdns-admin >/dev/null; then
+ useradd -u 980 --system -c 'powerdns-admin worker user' -g powerdns-admin -d / -s /usr/bin/nologin powerdns-admin
+ fi
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ userdel powerdns-admin 2>/dev/null >/dev/null
+ groupdel powerdns-admin 2>/dev/null >/dev/null
+
+ if getent passwd powerdns-admin >/dev/null; then
+ echo You may need to delete powerdns-admin user manually
+ fi
+ if getent group powerdns-admin >/dev/null; then
+ echo You may need to delete powerdns-admin group manually
+ fi
+}