File: config

package info (click to toggle)
totd 1.4-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 660 kB
  • ctags: 512
  • sloc: ansic: 5,840; sh: 2,826; perl: 111; makefile: 110
file content (95 lines) | stat: -rw-r--r-- 2,423 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/sh
set -e

test -f /usr/share/debconf/confmodule || exit 0
. /usr/share/debconf/confmodule

if [ "$1" = reconfigure ]; then
    db_fset totd/manage_with_debconf seen false
    db_fset totd/move_existing_nondebconf_config seen false
    db_fset totd/dns_server seen false
    db_fset totd/support_ipv6_prefix seen false
    db_fset totd/ipv6_prefix seen false
    db_fset totd/rewrite_dhcp_script seen false
    db_fset totd/use_ipv6 seen false
fi

db_input critical totd/manage_with_debconf || true
db_go || true

db_get totd/manage_with_debconf && usedebconf="$RET"

if [ "$usedebconf" = "Yes" ]; then
    db_set $TEMPLATE "true"
    usedebconf="true"
elif [ "$usedebconf" = "No" ]; then
    db_set $TEMPLATE "false"
    usedebconf="false"
fi

if [ "$usedebconf" = "true" ]; then
    db_fset totd/move_existing_nondebconf_config seen false
    db_fset totd/dns_server seen false
    db_fset totd/support_ipv6_prefix seen false
    db_fset totd/ipv6_prefix seen false
    db_fset totd/rewrite_resolv_conf seen false
    db_fset totd/rewrite_dhcp_script seen false
    db_fset totd/use_ipv6 seen false

    if [ -f /etc/totd.conf ]; then
	db_input high totd/move_existing_nondebconf_config || true
	db_go || true
	db_get totd/move_existing_nondebconf_config
	move_conf="$RET"

	if [ "$move_conf" = "Yes" ]; then
	    db_set $TEMPLATE "true"
	elif [ "$move_conf" = "No" ]; then
	    db_set $TEMPLATE "false"
	fi
    fi

    db_input critical totd/dns_server || true
    db_go || true

#    db_input low totd/support_ipv6_prefix && support_ipv6_prefix="$RET"
#    if [ $support_ipv6_prefix = "true" ]; then
#	db_input critical totd/ipv6_prefix || true
#    fi

    db_input low totd/rewrite_resolv_conf || true
    db_go || true
    db_get totd/rewrite_resolv_conf

    rewrite_resolv_conf="$RET"
    if [ "$rewrite_resolv_conf" = "Yes" ]; then
	db_set $TEMPLATE "true"
	rewrite_resolv_conf="true"
    elif [ "$move_conf" = "No" ]; then
	db_set $TEMPLATE "false"
	rewrite_resolv_conf="false"
    fi
    if [ "$rewrite_resolv_conf" = "true" ]; then
	db_input low totd/rewrite_dhcp_script || true
	db_go || true
    fi

    db_input low totd/use_ipv6 || true
    db_go || true
    db_get totd/use_ipv6

    use_ipv6="$RET"
    if [ "$use_ipv6" = "Yes" ]; then
	db_set $TEMPLATE "true"
	use_ipv6="true"
    elif [ "$use_ipv6" = "No" ]; then
    	db_set $TEMPLATE "false"
	use_ipv6="false"
    fi
fi

#DEBHELPER#

exit 0