#!/bin/sh
+# postinst script for pdns
set -e
-update_docbase() {
- if command -v install-docs >/dev/null 2>&1 ; then
- install-docs -i /usr/share/doc-base/pdns
- fi
-}
+case "$1" in
+ configure|abort-upgrade)
+ if command -v install-docs >/dev/null 2>&1 ; then
+ install-docs -i /usr/share/doc-base/pdns
+ fi
+ ;;
+ abort-remove|abort-deconfigure)
+ ;;
-if [ "$1" = "configure" -o "$1" = "abort-upgrade" ] ; then
- update_docbase
-fi
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+#DEBHELPER#
+
+exit 0
#!/bin/sh
+# prerm script for pdns
set -e
-update_docbase() {
- if command -v install-docs >/dev/null 2>&1 ; then
- install-docs -r pdns
- fi
-}
+case "$1" in
+ remove)
+ if command -v install-docs >/dev/null 2>&1 ; then
+ install-docs -r pdns
+ fi
+ ;;
-if [ "$1" = "remove" ] ; then
- update_docbase
-fi
+ failed-upgrade|upgrade|deconfigure)
+ ;;
+
+ *)
+ echo "prerm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
#!/bin/sh
+# postinst script for pdns
set -e
-update_init() {
- if [ -z "$2" ] ; then
- update-rc.d pdns defaults 15 85 > /dev/null
- fi
-}
+case "$1" in
+ configure)
+ if [ -z $2 ]; then
+ update-rc.d pdns defaults 15 85 > /dev/null
+ invoke-rc.d pdns start
+ else
+ invoke-rc.d pdns status > /dev/null
+ [ $? -eq 3 ] || invoke-rc.d pdns restart
+ fi
+ ;;
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
-update_pdns() {
- if [ -n "$2" ] ; then
- invoke-rc.d pdns start
- else
- invoke-rc.d pdns restart
- fi
-}
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
-if [ "$1" = "configure" -o "$1" = "abort-upgrade" ] ; then
- update_init "$@"
- update_pdns "$@"
-fi
+exit 0
#!/bin/sh
+# postrm script for pdns
set -e
-update_init() {
- update-rc.d pdns remove > /dev/null
-}
+case "$1" in
+ purge|remove)
+ update-rc.d pdns remove
+ ;;
+ |upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ ;;
-if [ "$1" = "purge" ] ; then
- update_init
- rmdir /etc/powerdns || true
-fi
+ *)
+ echo "postrm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+#DEBHELPER#
+
+exit 0
#!/bin/sh
+# prerm script for pdns
set -e
-if [ "$1" = "remove" ] ; then
- if command -v invoke-rc.d >/dev/null 2>&1; then
- invoke-rc.d pdns stop
- else
- /etc/init.d/pdns stop
- fi
-fi
+case "$1" in
+ remove|upgrade|deconfigure)
+ if command -v invoke-rc.d >/dev/null 2>&1; then
+ invoke-rc.d pdns stop
+ else
+ /etc/init.d/pdns stop
+ fi
+ ;;
+
+ failed-upgrade)
+ ;;
+
+ *)
+ echo "prerm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0