]> git.ipfire.org Git - people/ms/dnsmasq.git/blob - debian/postinst
Fix new poll() code for helper pipe. Removed CPU-spin.
[people/ms/dnsmasq.git] / debian / postinst
1 #!/bin/sh
2 set -e
3
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
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
24 if [ -e /var/run/dnsmasq/dnsmasq.pid ]; then
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
38