comparison debian/config @ 310:150e75d3c785 noffle

[svn] fixed config for in case of multiple servers
author godisch
date Wed, 19 Feb 2003 07:36:16 +0000
parents 3b5b7f3fd71f
children 5ec39beae9c5
comparison
equal deleted inserted replaced
309:21ba70d6eb38 310:150e75d3c785
1 #!/bin/sh 1 #!/bin/sh
2 # $Id: config 434 2003-02-14 13:54:32Z godisch $ 2 # $Id: config 444 2003-02-19 07:36:16Z 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 7
22 db_input high noffle/debconf && db_go || : 22 db_input high noffle/debconf && db_go || :
23 db_get noffle/debconf || RET="" 23 db_get noffle/debconf || RET=""
24 [ "$RET" = false ] && exit 0 24 [ "$RET" = false ] && exit 0
25 25
26 # read server port value from inetd.conf 26 # read server port value from inetd.conf
27 port="`grep '[[:space:]]/usr/bin/noffle[[:space:]]' /etc/inetd.conf | sed 's/^#<off># //;s/[[:space:]].*//' 2> /dev/null`" || : 27 port="`grep '[[:space:]]/usr/bin/noffle[[:space:]]' /etc/inetd.conf | head -n 1 | sed 's/^#<off># //;s/[[:space:]].*//' 2> /dev/null`" || :
28 if [ "$port" ]; then 28 if [ "$port" ]; then
29 # read port value from debconf db 29 # read port value from debconf db
30 db_get noffle/port || RET="" 30 db_get noffle/port || RET=""
31 # for upgrading from < 1.1.2 31 # for upgrading from < 1.1.2
32 [ "$RET" = 119 ] && RET=nntp 32 [ "$RET" = 119 ] && RET=nntp
37 fi 37 fi
38 38
39 # read server, username, password, maxfetch, default-expire from $server_config 39 # read server, username, password, maxfetch, default-expire from $server_config
40 if [ -s "$server_config" ]; then 40 if [ -s "$server_config" ]; then
41 db_get noffle/server || RET="" 41 db_get noffle/server || RET=""
42 server="`grep '^server' $server_config | sed 's/^server[[:space:]]*//;s/[[:space:]].*//' 2> /dev/null`" || : 42 server="`grep '^server' $server_config | head -n 1 | sed 's/^server[[:space:]]*//;s/[[:space:]].*//' 2> /dev/null`" || :
43 [ "$server" = "$RET" ] || db_fset noffle/server seen false || : 43 [ "$server" = "$RET" ] || db_fset noffle/server seen false || :
44 [ "$server" ] && db_set noffle/server "$server" || : 44 [ "$server" ] && db_set noffle/server "$server" || :
45 45
46 db_get noffle/username || RET="" 46 db_get noffle/username || RET=""
47 server="`grep '^server' $server_config | sed 's/^server[[:space:]]*//;s/[^[:space:]]*[[:space:]]*//;s/[[:space:]].*//' 2> /dev/null`" || : 47 server="`grep '^server' $server_config | head -n 1 | sed 's/^server[[:space:]]*//;s/[^[:space:]]*[[:space:]]*//;s/[[:space:]].*//' 2> /dev/null`" || :
48 [ "$username" = "$RET" ] || db_fset noffle/username seen false || : 48 [ "$username" = "$RET" ] || db_fset noffle/username seen false || :
49 [ "$username" ] && db_set noffle/username "$username" || : 49 [ "$username" ] && db_set noffle/username "$username" || :
50 50
51 db_get noffle/password || RET="" 51 db_get noffle/password || RET=""
52 server="`grep '^server' $server_config | sed 's/^server[[:space:]]*//;s/[^[:space:]]*[[:space:]]*//;s/[^[:space:]]*[[:space:]]*//;s/[[:space:]].*//' 2> /dev/null`" || : 52 server="`grep '^server' $server_config | head -n 1 | sed 's/^server[[:space:]]*//;s/[^[:space:]]*[[:space:]]*//;s/[^[:space:]]*[[:space:]]*//;s/[[:space:]].*//' 2> /dev/null`" || :
53 [ "$password" = "$RET" ] || db_fset noffle/password seen false || : 53 [ "$password" = "$RET" ] || db_fset noffle/password seen false || :
54 [ "$password" ] && db_set noffle/password "$password" || : 54 [ "$password" ] && db_set noffle/password "$password" || :
55 55
56 db_get noffle/maxfetch || RET="" 56 db_get noffle/maxfetch || RET=""
57 maxfetch="`grep '^max-fetch' $server_config | sed 's/^max-fetch[[:space:]]*//' 2> /dev/null`" || : 57 maxfetch="`grep '^max-fetch' $server_config | head -n 1 | sed 's/^max-fetch[[:space:]]*//' 2> /dev/null`" || :
58 [ "$maxfetch" = "$RET" ] || db_fset noffle/maxfetch seen false || : 58 [ "$maxfetch" = "$RET" ] || db_fset noffle/maxfetch seen false || :
59 [ "$maxfetch" ] && db_set noffle/maxfetch "$maxfetch" || : 59 [ "$maxfetch" ] && db_set noffle/maxfetch "$maxfetch" || :
60 60
61 db_get noffle/default-expire || RET="" 61 db_get noffle/default-expire || RET=""
62 defexpire="`grep '^default-expire' $server_config | sed 's/^default-expire[[:space:]]*//' 2> /dev/null`" || : 62 defexpire="`grep '^default-expire' $server_config | head -n 1 | sed 's/^default-expire[[:space:]]*//' 2> /dev/null`" || :
63 [ "$defexpire" = "$RET" ] || db_fset noffle/defexpire seen false || : 63 [ "$defexpire" = "$RET" ] || db_fset noffle/defexpire seen false || :
64 [ "$defexpire" ] && db_set noffle/default-expire "$defexpire" || : 64 [ "$defexpire" ] && db_set noffle/default-expire "$defexpire" || :
65 fi 65 fi
66 66
67 # better storing ppp/cron than 'via dialup'/'via permanent connection', 67 # better storing ppp/cron than 'via dialup'/'via permanent connection',