File: config

package info (click to toggle)
distcc 2.18.3-4.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,260 kB
  • ctags: 1,536
  • sloc: ansic: 12,829; sh: 3,490; python: 1,313; makefile: 506
file content (42 lines) | stat: -rw-r--r-- 903 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
37
38
39
40
41
42
#!/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

case "$1" in
    configure|reconfigure)
        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

        get_config_file LISTENER distcc/daemon-listen
        db_input medium distcc/daemon-listen || true
        db_go
        ;;
    *)
        ;;
esac

exit 0