blob: 155d325371f9ff9952c644c8835b2d5ccd66e69d [file] [log] [blame]
Simon Kelleyc72daea2012-01-05 21:33:27 +00001#!/bin/sh
2set -e
3
Andreas Metzler62f992f2014-05-11 17:53:54 +01004# Code copied from dh_systemd_enable ----------------------
5# This will only remove masks created by d-s-h on package removal.
6deb-systemd-helper unmask dnsmasq.service >/dev/null || true
7
8# was-enabled defaults to true, so new installations run enable.
9if 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
13else
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
17fi
18# End code copied from dh_systemd_enable ------------------
19
Simon Kelleyc72daea2012-01-05 21:33:27 +000020if [ -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 Kelley47901152015-09-29 22:54:41 +010024 if [ -e /run/dnsmasq/dnsmasq.pid ]; then
Simon Kelleyc72daea2012-01-05 21:33:27 +000025 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
36fi
37
Simon Kelleyc72daea2012-01-05 21:33:27 +000038