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