File: diskless-image-simple.config

package info (click to toggle)
diskless 0.3.6
  • links: PTS
  • area: main
  • in suites: potato
  • size: 460 kB
  • ctags: 111
  • sloc: perl: 2,467; sh: 375; makefile: 104
file content (192 lines) | stat: -rwxr-xr-x 4,436 bytes parent folder | download | duplicates (3)
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192

#!/bin/sh -e

# Source debconf library.
. /usr/share/debconf/confmodule
db_version 2.0

if [ -f "/etc/diskless-image/config" ]
then
	. /etc/diskless-image/config
	db_set diskless-image/master "$master"
	db_set diskless-image/nfsserver "$nfsserver"
	db_set diskless-image/nfsimagedir "$nfsimagedir"
	db_set diskless-image/nfshostsdir "$nfshostsdir"
	db_set diskless-image/nfshomedir "$nfshomedir"
	db_set diskless-image/nameserver "$nameserver"
	db_set diskless-image/domain "$domain"
	db_set diskless-image/maildomain "$maildomain"
	db_set diskless-image/devfs "$devfs"
fi

# This conf script is capable of backing up
db_capb backup

STATE=1 
while [ "$STATE" != stop ]; do
	case "$STATE" in
	1)
		# name of master
		db_input high diskless-image/master || true
		db_go
		
		# Check their answer.
		db_get diskless-image/master
		if ! db_go; then
			# Back button -- go back to first question.
			STATE=1
			# But first, ensure that all questions asked
			# so far will be asked again.
			db_fset foo/master isdefault true
		else
			# Proceed to second question.
			STATE=2
		fi
	;;
	
	2)
		# address of NFS server
		db_input high diskless-image/nfsserver || true
		if ! db_go; then
			# Back button -- go back to first question.
			STATE=1
			# But first, ensure that all questions asked
			# so far will be asked again.
			db_fset foo/master isdefault true
			db_fset foo/nfsserver isdefault true
		else
			# Proceed to second question.
			STATE=3
		fi
	;;

	3)
		# nfs image dir
		db_input high diskless-image/nfsimagedir || true
		if ! db_go; then
			# Back button -- go back to first question.
			STATE=2
			# But first, ensure that all questions asked
			# so far will be asked again.
			db_fset foo/nfsserver isdefault true
			db_fset foo/nfsimagedir isdefault true
		else
			# Proceed to second question.
			STATE=4
		fi
	;;

	4)
		# nfs hosts dir
		db_input high diskless-image/nfshostsdir || true
		if ! db_go; then
			# Back button -- go back to first question.
			STATE=3
			# But first, ensure that all questions asked
			# so far will be asked again.
			db_fset foo/nfsimagedir isdefault true
			db_fset foo/nfshostsdir isdefault true
		else
			# Proceed to second question.
			STATE=5
		fi
	;;

	5)
		# nfs home directories
		db_input high diskless-image/nfshomedir || true
		if ! db_go; then
			# Back button -- go back to first question.
			STATE=4
			# But first, ensure that all questions asked
			# so far will be asked again.
			db_fset foo/nfsimagedir isdefault true
			db_fset foo/nfshomedir isdefault true
		else
			# Proceed to second question.
			STATE=6
		fi
	;;


	6)
		# IP address of name server
		db_input high diskless-image/nameserver || true
		if ! db_go; then
			# Back button -- go back to first question.
			STATE=5
			# But first, ensure that all questions asked
			# so far will be asked again.
			db_fset foo/master isdefault true
			db_fset foo/nameserver isdefault true
		else
			# Proceed to second question.
			STATE=7
		fi
	;;

	7)
		# IP address of name server
		db_input high diskless-image/domain || true
		if ! db_go; then
			# Back button -- go back to first question.
			STATE=6
			# But first, ensure that all questions asked
			# so far will be asked again.
			db_fset foo/nameserver isdefault true
			db_fset foo/domain isdefault true
		else
			# Proceed to second question.
			STATE=8
		fi
	;;

	8)
		# mail domain
		db_input high diskless-image/maildomain || true
		if ! db_go; then
			# Back button -- go back to first question.
			STATE=7
			# But first, ensure that all questions asked
			# so far will be asked again.
			db_fset foo/domain isdefault true
			db_fset foo/maildomain isdefault true
		else
			# Proceed to second question.
			STATE=9
		fi
	;;

	9)
		# mail route
		db_input high diskless-image/mailroute || true
		if ! db_go; then
			# Back button -- go back to first question.
			STATE=8
			# But first, ensure that all questions asked
			# so far will be asked again.
			db_fset foo/maildomain isdefault true
			db_fset foo/mailroute isdefault true
		else
			# Proceed to second question.
			STATE=10
		fi
	;;

	10)
		# devfs
		db_input high diskless-image/devfs || true
		if ! db_go; then
			# Back button -- go back to first question.
			STATE=9
			# But first, ensure that all questions asked
			# so far will be asked again.
			db_fset foo/mailroute isdefault true
			db_fset foo/devfs isdefault true
		else
			# All done.
			STATE=stop
		fi
	;;
	esac
done