Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | set -e |
| 3 | |
Andreas Metzler | 62f992f | 2014-05-11 17:53:54 +0100 | [diff] [blame] | 4 | # Code copied from dh_systemd_enable ---------------------- |
| 5 | # This will only remove masks created by d-s-h on package removal. |
| 6 | deb-systemd-helper unmask dnsmasq.service >/dev/null || true |
| 7 | |
| 8 | # was-enabled defaults to true, so new installations run enable. |
| 9 | if deb-systemd-helper --quiet was-enabled dnsmasq.service; then |
| 10 | # Enables the unit on first installation, creates new |
| 11 | # symlinks on upgrades if the unit file has changed. |
| 12 | deb-systemd-helper enable dnsmasq.service >/dev/null || true |
| 13 | else |
| 14 | # Update the statefile to add new symlinks (if any), which need to be |
| 15 | # cleaned up on purge. Also remove old symlinks. |
| 16 | deb-systemd-helper update-state dnsmasq.service >/dev/null || true |
| 17 | fi |
| 18 | # End code copied from dh_systemd_enable ------------------ |
| 19 | |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 20 | if [ -x /etc/init.d/dnsmasq ]; then |
| 21 | update-rc.d dnsmasq defaults 15 85 >/dev/null |
| 22 | |
| 23 | if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then |
Simon Kelley | 4790115 | 2015-09-29 22:54:41 +0100 | [diff] [blame] | 24 | if [ -e /run/dnsmasq/dnsmasq.pid ]; then |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 25 | ACTION=restart |
| 26 | else |
| 27 | ACTION=start |
| 28 | fi |
| 29 | |
| 30 | if [ -x /usr/sbin/invoke-rc.d ] ; then |
| 31 | invoke-rc.d dnsmasq $ACTION || true |
| 32 | else |
| 33 | /etc/init.d/dnsmasq $ACTION || true |
| 34 | fi |
| 35 | fi |
| 36 | fi |
| 37 | |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 38 | |