~matsubara/maas/packaging-fix-patches

« back to all changes in this revision

Viewing changes to debian/maas-dhcp.postinst

  • Committer: Tarmac
  • Author(s): Andres Rodriguez
  • Date: 2012-04-10 04:40:28 UTC
  • mfrom: (36.1.1 packaging)
  • Revision ID: ed@carob-20120410044028-mir71hc5ycahunwe
[r=andreserl,julian-edwards][bug=975321][author=andreserl] * debian/maas-dhcp.{config,postinst}:
  - Fix not setting new values on fresh install. (LP: #975321)
  - Fix unsetting domain, otherwise, even if disabled, it will always be set.
* debian/control: Depends on maas for maas-dhcp.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
db_version 2.0
5
5
 
6
6
if ([ "$1" = "configure" ] && [ -z "$2" ]) || [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then
 
7
        db_input high maas-dhcp/dnsmasq-dhcp-range || true
 
8
        db_go
 
9
        db_input high maas-dhcp/dnsmasq-default-gateway || true
 
10
        db_go
 
11
        db_input high maas-dhcp/dnsmasq-domain-name || true
 
12
        db_go
7
13
 
8
14
        # Setup dnsmasq
9
15
        sed -i -e "s/^manage_dns:.*$/manage_dns: 1/" \
39
45
                elif grep -qs "^domain=.*$" /etc/cobbler/dnsmasq.template; then
40
46
                        sed -i -e "s/^domain=.*$/domain=$domain/" /etc/cobbler/dnsmasq.template
41
47
                fi
 
48
        elif [ -z "$domain" ]; then
 
49
                # if the domain has been set to empty, then disable it
 
50
                if grep -qs "^domain=.*$" /etc/cobbler/dnsmasq.template; then
 
51
                        sed -i -e "s/^domain=.*$/#domain=/" /etc/cobbler/dnsmasq.template
 
52
                fi
42
53
        fi
43
54
        if [ -x /usr/sbin/invoke-rc.d ]; then
44
55
                invoke-rc.d cobbler restart || true