Mercurial > noffle
comparison debian/config @ 396:e144202d2d96 noffle
[svn] updated deb'configuration
author | godisch |
---|---|
date | Thu, 29 May 2003 15:55:19 +0100 |
parents | 056d5fcb7f4b |
children | afa2ff7b5ebf |
comparison
equal
deleted
inserted
replaced
395:056d5fcb7f4b | 396:e144202d2d96 |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 # $Id: config 537 2003-05-29 14:44:56Z godisch $ | 2 # $Id: config 538 2003-05-29 14:55:19Z 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 |
25 if [ ! -e $server_config -a ! -e $debian_config -a -e /etc/noffle/conf ]; then | 25 if [ ! -e $server_config -a ! -e $debian_config -a -e /etc/noffle/conf ]; then |
26 server_config=/etc/noffle/conf | 26 server_config=/etc/noffle/conf |
27 debian_config=/etc/noffle/conf.debian | 27 debian_config=/etc/noffle/conf.debian |
28 fi | 28 fi |
29 | 29 |
30 # read server port value from inetd.conf | |
31 port="`grep '[[:space:]]/usr/bin/noffle[[:space:]]' /etc/inetd.conf | head -n 1 | sed 's/^#<off># //;s/[[:space:]].*//' 2> /dev/null`" || : | |
32 if [ "$port" ]; then | |
33 # read port value from debconf db | |
34 db_get noffle/port | |
35 # for upgrading from < 1.1.2 | |
36 [ "$RET" = 119 ] && RET=nntp || : | |
37 # we need confirmation, if they differ | |
38 [ "$port" = "$RET" ] || db_fset noffle/port seen false | |
39 # write current port from inetd.conf into debconf db | |
40 [ "$port" = "${port#\#}" ] && db_set noffle/port "$port" || : | |
41 fi | |
42 | |
43 # read server, username, password, maxfetch, default-expire from $server_config | |
44 if [ -s "$server_config" ]; then | |
45 db_get noffle/server | |
46 server="`grep '^server' $server_config | head -n 1 | sed 's/^server[[:space:]]*//;s/[[:space:]].*//' 2> /dev/null`" || : | |
47 [ "$server" = "$RET" ] || db_fset noffle/server seen false | |
48 [ "$server" ] && db_set noffle/server "$server" || : | |
49 | |
50 db_get noffle/username | |
51 server="`grep '^server' $server_config | head -n 1 | sed 's/^server[[:space:]]*//;s/[^[:space:]]*[[:space:]]*//;s/[[:space:]].*//' 2> /dev/null`" || : | |
52 [ "$username" = "$RET" ] || db_fset noffle/username seen false | |
53 [ "$username" ] && db_set noffle/username "$username" || : | |
54 | |
55 db_get noffle/password | |
56 server="`grep '^server' $server_config | head -n 1 | sed 's/^server[[:space:]]*//;s/[^[:space:]]*[[:space:]]*//;s/[^[:space:]]*[[:space:]]*//;s/[[:space:]].*//' 2> /dev/null`" || : | |
57 [ "$password" = "$RET" ] || db_fset noffle/password seen false | |
58 [ "$password" ] && db_set noffle/password "$password" || : | |
59 | |
60 db_get noffle/maxfetch | |
61 maxfetch="`grep '^max-fetch' $server_config | head -n 1 | sed 's/^max-fetch[[:space:]]*//' 2> /dev/null`" || : | |
62 [ "$maxfetch" = "$RET" ] || db_fset noffle/maxfetch seen false | |
63 [ "$maxfetch" ] && db_set noffle/maxfetch "$maxfetch" || : | |
64 | |
65 db_get noffle/default-expire | |
66 defexpire="`grep '^default-expire' $server_config | head -n 1 | sed 's/^default-expire[[:space:]]*//' 2> /dev/null`" || : | |
67 [ "$defexpire" = "$RET" ] || db_fset noffle/defexpire seen false | |
68 [ "$defexpire" ] && db_set noffle/default-expire "$defexpire" || : | |
69 fi | |
70 | |
71 # for backward compatibility < 1.1.2-1 | 30 # for backward compatibility < 1.1.2-1 |
72 if dpkg --compare-versions "$2" lt-nl 1.1.2; then | 31 if dpkg --compare-versions "$2" lt-nl 1.1.2; then |
73 db_get noffle/fetchmode | 32 db_get noffle/fetchmode |
74 case "$RET" in | 33 case "$RET" in |
75 'via dialup') db_set noffle/fetchmode ppp;; | 34 'via dialup') db_set noffle/fetchmode ppp;; |
76 'via permanent connection') db_set noffle/fetchmode cron;; | 35 'via permanent connection') db_set noffle/fetchmode cron;; |
77 esac | 36 esac |
78 fi | 37 fi |
79 | |
80 # read NOFFLE_FETCHMODE from $debian_config | |
81 [ -s "$debian_config" ] && . $debian_config || : | |
82 [ "$NOFFLE_FETCHMODE" = ppp -o "$NOFFLE_FETCHMODE" = cron ] || \ | |
83 if [ -x /usr/sbin/pppd ]; then | |
84 NOFFLE_FETCHMODE=ppp | |
85 else | |
86 NOFFLE_FETCHMODE=cron | |
87 fi | |
88 # do we need confirmation? | |
89 db_get noffle/fetchmode | |
90 [ "$NOFFLE_FETCHMODE" = "$RET" ] || db_fset noffle/fetchmode seen false | |
91 | 38 |
92 # input configuration using backup capability, see debconf-devel(8) | 39 # input configuration using backup capability, see debconf-devel(8) |
93 state=1 | 40 state=1 |
94 laststate=7 | 41 laststate=7 |
95 while [ "$state" -ge 0 -a "$state" -le "$laststate" ]; do | 42 while [ "$state" -ge 0 -a "$state" -le "$laststate" ]; do |