This file is indexed.

config is in maas-dhcp 0.1+bzr482+dfsg-0ubuntu1.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh -e

# Only ask this question on new installs and reconfigures
if ([ "$1" = "configure" ] && [ -z "$2" ]) || [ "$1" = "reconfigure" ]; then
        . /usr/share/debconf/confmodule

	# Try to obtain the default range for dnsmasq-dhcp-range and set it
	range=$(grep -s "^dhcp-range=.*$" /etc/cobbler/dnsmasq.template | awk '{split($0,array,"=")} END{print array[2]}')
	if [ -n "$range" ]; then
		db_set maas-dhcp/dnsmasq-dhcp-range "$range"
	fi

	# try to obtain the default gateway and set it
	gateway=$(grep -s "^dhcp-option=.*$" /etc/cobbler/dnsmasq.template | awk '{split($0,array,"3,")} END{print array[2]}')
	if [ "$gateway" = "\$next_server" ]; then
		# If gateway is $next_server, obtain the IP address of gateway
		gateway=$(grep -s "^next_server:.*$" /etc/cobbler/settings | awk '{split($0,array,": ")} END{print array[2]}')
	fi
	if [ -n "$gateway" ]; then
		db_set maas-dhcp/dnsmasq-default-gateway "$gateway"
	fi

	# try to obtain the domain and set it
	domain=$(grep -s "^domain=.*$" /etc/cobbler/dnsmasq.template | awk '{split($0,array,"=")} END{print array[2]}')
	if [ -n "$domain" ]; then
		db_set maas-dhcp/dnsmasq-domain-name "$domain"
	fi

fi