comparison debian/config @ 360:a23b37308063 noffle

[svn] || true cleanup
author godisch
date Sat, 29 Mar 2003 06:57:20 +0000
parents d1007cf6a49c
children dec92f910289
comparison
equal deleted inserted replaced
359:d1007cf6a49c 360:a23b37308063
1 #!/bin/sh 1 #!/bin/sh
2 # $Id: config 497 2003-03-28 22:17:33Z godisch $ 2 # $Id: config 499 2003-03-29 06:57:20Z godisch $
3 3
4 set -e 4 set -e
5 . /usr/share/debconf/confmodule 5 . /usr/share/debconf/confmodule
6 db_version 2.0 6 db_version 2.0
7 db_capb backup 7 db_capb backup
21 21
22 # are we using debconf? 22 # are we using debconf?
23 db_input high noffle/debconf && db_go || : 23 db_input high noffle/debconf && db_go || :
24 db_get noffle/debconf 24 db_get noffle/debconf
25 if [ "$RET" = false ]; then 25 if [ "$RET" = false ]; then
26 db_stop
26 exit 0 27 exit 0
27 fi 28 fi
28 29
29 # read server port value from inetd.conf 30 # read server port value from inetd.conf
30 port="`grep '[[:space:]]/usr/bin/noffle[[:space:]]' /etc/inetd.conf | head -n 1 | sed 's/^#<off># //;s/[[:space:]].*//' 2> /dev/null`" || : 31 port="`grep '[[:space:]]/usr/bin/noffle[[:space:]]' /etc/inetd.conf | head -n 1 | sed 's/^#<off># //;s/[[:space:]].*//' 2> /dev/null`" || :
31 if [ "$port" ]; then 32 if [ "$port" ]; then
32 # read port value from debconf db 33 # read port value from debconf db
33 db_get noffle/port || RET="" 34 db_get noffle/port
34 # for upgrading from < 1.1.2 35 # for upgrading from < 1.1.2
35 [ "$RET" = 119 ] && RET=nntp || : 36 [ "$RET" = 119 ] && RET=nntp || :
36 # we need confirmation, if they differ 37 # we need confirmation, if they differ
37 [ "$port" = "$RET" ] || db_fset noffle/port seen false || : 38 [ "$port" = "$RET" ] || db_fset noffle/port seen false
38 # write current port from inetd.conf into debconf db 39 # write current port from inetd.conf into debconf db
39 [ "$port" = "${port#\#}" ] && db_set noffle/port "$port" || : 40 [ "$port" = "${port#\#}" ] && db_set noffle/port "$port" || :
40 fi 41 fi
41 42
42 # read server, username, password, maxfetch, default-expire from $server_config 43 # read server, username, password, maxfetch, default-expire from $server_config
43 if [ -s "$server_config" ]; then 44 if [ -s "$server_config" ]; then
44 db_get noffle/server || RET="" 45 db_get noffle/server
45 server="`grep '^server' $server_config | head -n 1 | sed 's/^server[[:space:]]*//;s/[[:space:]].*//' 2> /dev/null`" || : 46 server="`grep '^server' $server_config | head -n 1 | sed 's/^server[[:space:]]*//;s/[[:space:]].*//' 2> /dev/null`" || :
46 [ "$server" = "$RET" ] || db_fset noffle/server seen false || : 47 [ "$server" = "$RET" ] || db_fset noffle/server seen false
47 [ "$server" ] && db_set noffle/server "$server" || : 48 [ "$server" ] && db_set noffle/server "$server" || :
48 49
49 db_get noffle/username || RET="" 50 db_get noffle/username
50 server="`grep '^server' $server_config | head -n 1 | sed 's/^server[[:space:]]*//;s/[^[:space:]]*[[:space:]]*//;s/[[:space:]].*//' 2> /dev/null`" || : 51 server="`grep '^server' $server_config | head -n 1 | sed 's/^server[[:space:]]*//;s/[^[:space:]]*[[:space:]]*//;s/[[:space:]].*//' 2> /dev/null`" || :
51 [ "$username" = "$RET" ] || db_fset noffle/username seen false || : 52 [ "$username" = "$RET" ] || db_fset noffle/username seen false
52 [ "$username" ] && db_set noffle/username "$username" || : 53 [ "$username" ] && db_set noffle/username "$username" || :
53 54
54 db_get noffle/password || RET="" 55 db_get noffle/password
55 server="`grep '^server' $server_config | head -n 1 | sed 's/^server[[:space:]]*//;s/[^[:space:]]*[[:space:]]*//;s/[^[:space:]]*[[:space:]]*//;s/[[:space:]].*//' 2> /dev/null`" || : 56 server="`grep '^server' $server_config | head -n 1 | sed 's/^server[[:space:]]*//;s/[^[:space:]]*[[:space:]]*//;s/[^[:space:]]*[[:space:]]*//;s/[[:space:]].*//' 2> /dev/null`" || :
56 [ "$password" = "$RET" ] || db_fset noffle/password seen false || : 57 [ "$password" = "$RET" ] || db_fset noffle/password seen false
57 [ "$password" ] && db_set noffle/password "$password" || : 58 [ "$password" ] && db_set noffle/password "$password" || :
58 59
59 db_get noffle/maxfetch || RET="" 60 db_get noffle/maxfetch
60 maxfetch="`grep '^max-fetch' $server_config | head -n 1 | sed 's/^max-fetch[[:space:]]*//' 2> /dev/null`" || : 61 maxfetch="`grep '^max-fetch' $server_config | head -n 1 | sed 's/^max-fetch[[:space:]]*//' 2> /dev/null`" || :
61 [ "$maxfetch" = "$RET" ] || db_fset noffle/maxfetch seen false || : 62 [ "$maxfetch" = "$RET" ] || db_fset noffle/maxfetch seen false
62 [ "$maxfetch" ] && db_set noffle/maxfetch "$maxfetch" || : 63 [ "$maxfetch" ] && db_set noffle/maxfetch "$maxfetch" || :
63 64
64 db_get noffle/default-expire || RET="" 65 db_get noffle/default-expire
65 defexpire="`grep '^default-expire' $server_config | head -n 1 | sed 's/^default-expire[[:space:]]*//' 2> /dev/null`" || : 66 defexpire="`grep '^default-expire' $server_config | head -n 1 | sed 's/^default-expire[[:space:]]*//' 2> /dev/null`" || :
66 [ "$defexpire" = "$RET" ] || db_fset noffle/defexpire seen false || : 67 [ "$defexpire" = "$RET" ] || db_fset noffle/defexpire seen false
67 [ "$defexpire" ] && db_set noffle/default-expire "$defexpire" || : 68 [ "$defexpire" ] && db_set noffle/default-expire "$defexpire" || :
68 fi 69 fi
69 70
70 # for backward compatibility < 1.1.2-1 71 # for backward compatibility < 1.1.2-1
71 if dpkg --compare-versions "$2" lt-nl 1.1.2; then 72 if dpkg --compare-versions "$2" lt-nl 1.1.2; then
72 db_get noffle/fetchmode || RET="" 73 db_get noffle/fetchmode
73 case "$RET" in 74 case "$RET" in
74 'via dialup') db_set noffle/fetchmode ppp || :;; 75 'via dialup') db_set noffle/fetchmode ppp;;
75 'via permanent connection') db_set noffle/fetchmode cron || :;; 76 'via permanent connection') db_set noffle/fetchmode cron;;
76 esac 77 esac
77 fi 78 fi
78 79
79 # read NOFFLE_FETCHMODE from $debian_config 80 # read NOFFLE_FETCHMODE from $debian_config
80 [ -s "$debian_config" ] && . $debian_config || : 81 [ -s "$debian_config" ] && . $debian_config || :
83 NOFFLE_FETCHMODE=ppp 84 NOFFLE_FETCHMODE=ppp
84 else 85 else
85 NOFFLE_FETCHMODE=cron 86 NOFFLE_FETCHMODE=cron
86 fi 87 fi
87 # do we need confirmation? 88 # do we need confirmation?
88 db_get noffle/fetchmode || RET="" 89 db_get noffle/fetchmode
89 [ "$NOFFLE_FETCHMODE" = "$RET" ] || db_fset noffle/fetchmode seen false || : 90 [ "$NOFFLE_FETCHMODE" = "$RET" ] || db_fset noffle/fetchmode seen false
90 91
91 # input configuration using backup capability, see debconf-devel(8) 92 # input configuration using backup capability, see debconf-devel(8)
92 state=1 93 state=1
93 laststate=7 94 laststate=7
94 while [ "$state" -gt 0 -a "$state" -le "$laststate" ]; do 95 while [ "$state" -gt 0 -a "$state" -le "$laststate" ]; do