File: config

package info (click to toggle)
distcc 2.18.3-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,188 kB
  • ctags: 1,536
  • sloc: ansic: 12,829; sh: 3,183; python: 1,313; makefile: 493
file content (36 lines) | stat: -rw-r--r-- 728 bytes parent folder | download
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
30
31
32
33
34
35
36
#!/bin/sh 
# distcc package configuration script

conffile="/etc/default/distcc"

get_config_file()
{
	config_field=$1
	db_field=$2
	
	if [ -f "$conffile" ] ; then
   		VALUE="$(grep "^[ ]*$config_field" $conffile | sed -e "s/^$config_field *= *\"\(.*\)\"/\1/g")" 
		if [ -n "$VALUE" ] ; then
			db_set $db_field "$VALUE"
		fi
	fi		
}

# Source debconf library -- we have a Depends line
# to make sure it is there...
. /usr/share/debconf/confmodule
db_version 2.0

if [ "$1" = configure -o "$1" = reconfigure ] ; then
	
	get_config_file STARTDISTCC distcc/daemon
	db_input medium distcc/daemon || true
    db_go
	
	get_config_file ALLOWEDNETS distcc/daemon-allow
	db_input medium distcc/daemon-allow || true
	db_go
	
fi

exit 0