301
|
1 #!/bin/sh
|
424
|
2 # $Id: config 567 2003-06-20 15:58:53Z 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
|
324
|
17 # for backward compatibility < 1.1.2-1
|
301
|
18 if dpkg --compare-versions "$2" lt-nl 1.1.2; then
|
360
|
19 db_get noffle/fetchmode
|
301
|
20 case "$RET" in
|
360
|
21 'via dialup') db_set noffle/fetchmode ppp;;
|
|
22 'via permanent connection') db_set noffle/fetchmode cron;;
|
301
|
23 esac
|
|
24 fi
|
|
25
|
359
|
26 # input configuration using backup capability, see debconf-devel(8)
|
362
|
27 state=1
|
|
28 laststate=7
|
|
29 while [ "$state" -ge 0 -a "$state" -le "$laststate" ]; do
|
359
|
30 case "$state" in
|
364
|
31 0) db_input high noffle/debconf || :
|
|
32 ;;
|
|
33 1) db_input low noffle/port || :
|
|
34 ;;
|
|
35 2) db_input high noffle/server || :
|
|
36 ;;
|
|
37 3) db_input medium noffle/username || :
|
|
38 ;;
|
363
|
39 4) db_get noffle/username
|
364
|
40 [ "$RET" ] && db_input medium noffle/password || :
|
|
41 ;;
|
|
42 5) db_input medium noffle/fetchmode || :
|
|
43 ;;
|
|
44 6) db_input medium noffle/maxfetch || :
|
|
45 ;;
|
|
46 7) db_input low noffle/default-expire || :
|
|
47 ;;
|
359
|
48 esac
|
|
49 if db_go; then
|
362
|
50 if [ "$state" -eq 0 ]; then
|
361
|
51 db_get noffle/debconf
|
362
|
52 [ "$RET" = true ] || break
|
361
|
53 fi
|
359
|
54 state=$(($state + 1))
|
|
55 else
|
364
|
56 state=0
|
359
|
57 fi
|
|
58 done
|
301
|
59
|
333
|
60 db_stop
|
301
|
61 exit 0
|