annotate debian/config @ 396:e144202d2d96 noffle

[svn] updated deb'configuration
author godisch
date Thu, 29 May 2003 15:55:19 +0100
parents 056d5fcb7f4b
children afa2ff7b5ebf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
1 #!/bin/sh
396
e144202d2d96 [svn] updated deb'configuration
godisch
parents: 395
diff changeset
2 # $Id: config 538 2003-05-29 14:55:19Z godisch $
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
3
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
4 set -e
359
d1007cf6a49c [svn] added preliminary debconf backup capability
godisch
parents: 341
diff changeset
5 . /usr/share/debconf/confmodule
d1007cf6a49c [svn] added preliminary debconf backup capability
godisch
parents: 341
diff changeset
6 db_version 2.0
d1007cf6a49c [svn] added preliminary debconf backup capability
godisch
parents: 341
diff changeset
7 db_capb backup
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
8
395
056d5fcb7f4b [svn] updated deb'configuration
godisch
parents: 364
diff changeset
9 # are we using debconf?
056d5fcb7f4b [svn] updated deb'configuration
godisch
parents: 364
diff changeset
10 db_input high noffle/debconf && db_go || :
056d5fcb7f4b [svn] updated deb'configuration
godisch
parents: 364
diff changeset
11 db_get noffle/debconf
056d5fcb7f4b [svn] updated deb'configuration
godisch
parents: 364
diff changeset
12 if [ "$RET" = false ]; then
056d5fcb7f4b [svn] updated deb'configuration
godisch
parents: 364
diff changeset
13 db_stop
056d5fcb7f4b [svn] updated deb'configuration
godisch
parents: 364
diff changeset
14 exit 0
056d5fcb7f4b [svn] updated deb'configuration
godisch
parents: 364
diff changeset
15 fi
056d5fcb7f4b [svn] updated deb'configuration
godisch
parents: 364
diff changeset
16
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
17 server_config=/etc/news/noffle.conf
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
18 debian_config=/etc/default/noffle
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
19
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
20 # for backward compatibility = 1.1.2-1, since postinst is not run yet
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
21 if [ ! -e $server_config -a -e /etc/noffle.conf ]; then
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
22 server_config=/etc/noffle.conf
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
23 fi
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
24 # for backward compatibility < 1.1.2-1
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
25 if [ ! -e $server_config -a ! -e $debian_config -a -e /etc/noffle/conf ]; then
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
26 server_config=/etc/noffle/conf
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
27 debian_config=/etc/noffle/conf.debian
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
28 fi
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
29
324
5ec39beae9c5 [svn] cleanup
godisch
parents: 310
diff changeset
30 # for backward compatibility < 1.1.2-1
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
31 if dpkg --compare-versions "$2" lt-nl 1.1.2; then
360
a23b37308063 [svn] || true cleanup
godisch
parents: 359
diff changeset
32 db_get noffle/fetchmode
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
33 case "$RET" in
360
a23b37308063 [svn] || true cleanup
godisch
parents: 359
diff changeset
34 'via dialup') db_set noffle/fetchmode ppp;;
a23b37308063 [svn] || true cleanup
godisch
parents: 359
diff changeset
35 'via permanent connection') db_set noffle/fetchmode cron;;
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
36 esac
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
37 fi
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
38
359
d1007cf6a49c [svn] added preliminary debconf backup capability
godisch
parents: 341
diff changeset
39 # input configuration using backup capability, see debconf-devel(8)
362
c036f2b55576 [svn] cleanup
godisch
parents: 361
diff changeset
40 state=1
c036f2b55576 [svn] cleanup
godisch
parents: 361
diff changeset
41 laststate=7
c036f2b55576 [svn] cleanup
godisch
parents: 361
diff changeset
42 while [ "$state" -ge 0 -a "$state" -le "$laststate" ]; do
359
d1007cf6a49c [svn] added preliminary debconf backup capability
godisch
parents: 341
diff changeset
43 case "$state" in
364
36296f2b60e6 [svn] changed debconf backup
godisch
parents: 363
diff changeset
44 0) db_input high noffle/debconf || :
36296f2b60e6 [svn] changed debconf backup
godisch
parents: 363
diff changeset
45 ;;
36296f2b60e6 [svn] changed debconf backup
godisch
parents: 363
diff changeset
46 1) db_input low noffle/port || :
36296f2b60e6 [svn] changed debconf backup
godisch
parents: 363
diff changeset
47 ;;
36296f2b60e6 [svn] changed debconf backup
godisch
parents: 363
diff changeset
48 2) db_input high noffle/server || :
36296f2b60e6 [svn] changed debconf backup
godisch
parents: 363
diff changeset
49 ;;
36296f2b60e6 [svn] changed debconf backup
godisch
parents: 363
diff changeset
50 3) db_input medium noffle/username || :
36296f2b60e6 [svn] changed debconf backup
godisch
parents: 363
diff changeset
51 ;;
363
014146ed83bf [svn] cleanup
godisch
parents: 362
diff changeset
52 4) db_get noffle/username
364
36296f2b60e6 [svn] changed debconf backup
godisch
parents: 363
diff changeset
53 [ "$RET" ] && db_input medium noffle/password || :
36296f2b60e6 [svn] changed debconf backup
godisch
parents: 363
diff changeset
54 ;;
36296f2b60e6 [svn] changed debconf backup
godisch
parents: 363
diff changeset
55 5) db_input medium noffle/fetchmode || :
36296f2b60e6 [svn] changed debconf backup
godisch
parents: 363
diff changeset
56 ;;
36296f2b60e6 [svn] changed debconf backup
godisch
parents: 363
diff changeset
57 6) db_input medium noffle/maxfetch || :
36296f2b60e6 [svn] changed debconf backup
godisch
parents: 363
diff changeset
58 ;;
36296f2b60e6 [svn] changed debconf backup
godisch
parents: 363
diff changeset
59 7) db_input low noffle/default-expire || :
36296f2b60e6 [svn] changed debconf backup
godisch
parents: 363
diff changeset
60 ;;
359
d1007cf6a49c [svn] added preliminary debconf backup capability
godisch
parents: 341
diff changeset
61 esac
d1007cf6a49c [svn] added preliminary debconf backup capability
godisch
parents: 341
diff changeset
62 if db_go; then
362
c036f2b55576 [svn] cleanup
godisch
parents: 361
diff changeset
63 if [ "$state" -eq 0 ]; then
361
dec92f910289 [svn] improved debconf backup capability
godisch
parents: 360
diff changeset
64 db_get noffle/debconf
362
c036f2b55576 [svn] cleanup
godisch
parents: 361
diff changeset
65 [ "$RET" = true ] || break
361
dec92f910289 [svn] improved debconf backup capability
godisch
parents: 360
diff changeset
66 fi
359
d1007cf6a49c [svn] added preliminary debconf backup capability
godisch
parents: 341
diff changeset
67 state=$(($state + 1))
d1007cf6a49c [svn] added preliminary debconf backup capability
godisch
parents: 341
diff changeset
68 else
364
36296f2b60e6 [svn] changed debconf backup
godisch
parents: 363
diff changeset
69 state=0
359
d1007cf6a49c [svn] added preliminary debconf backup capability
godisch
parents: 341
diff changeset
70 fi
d1007cf6a49c [svn] added preliminary debconf backup capability
godisch
parents: 341
diff changeset
71 done
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
72
333
47ba9cbc7b75 [svn] added db_stop
godisch
parents: 324
diff changeset
73 db_stop
301
3b5b7f3fd71f [svn] initial debian/ upload
godisch
parents:
diff changeset
74 exit 0