comparison debian/config @ 339:ff1945b26212 noffle

[svn] cleanup bugfix
author godisch
date Tue, 04 Mar 2003 21:08:27 +0000
parents 47ba9cbc7b75
children 8f8db12ae359
comparison
equal deleted inserted replaced
338:fa7a42b18bc8 339:ff1945b26212
1 #!/bin/sh 1 #!/bin/sh
2 # $Id: config 469 2003-03-01 17:39:39Z godisch $ 2 # $Id: config 475 2003-03-04 21:08:27Z godisch $
3 3
4 set -e 4 set -e
5 5
6 server_config=/etc/news/noffle.conf 6 server_config=/etc/news/noffle.conf
7 debian_config=/etc/default/noffle 7 debian_config=/etc/default/noffle
20 db_version 2.0 20 db_version 2.0
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 || RET="" 24 db_get noffle/debconf || RET=""
25 [ "$RET" = false ] && exit 0 25 [ "$RET" = false ] && exit 0 || :
26 26
27 # read server port value from inetd.conf 27 # read server port value from inetd.conf
28 port="`grep '[[:space:]]/usr/bin/noffle[[:space:]]' /etc/inetd.conf | head -n 1 | sed 's/^#<off># //;s/[[:space:]].*//' 2> /dev/null`" || : 28 port="`grep '[[:space:]]/usr/bin/noffle[[:space:]]' /etc/inetd.conf | head -n 1 | sed 's/^#<off># //;s/[[:space:]].*//' 2> /dev/null`" || :
29 if [ "$port" ]; then 29 if [ "$port" ]; then
30 # read port value from debconf db 30 # read port value from debconf db
31 db_get noffle/port || RET="" 31 db_get noffle/port || RET=""
32 # for upgrading from < 1.1.2 32 # for upgrading from < 1.1.2
33 [ "$RET" = 119 ] && RET=nntp 33 [ "$RET" = 119 ] && RET=nntp || :
34 # we need confirmation, if they differ 34 # we need confirmation, if they differ
35 [ "$port" = "$RET" ] || db_fset noffle/port seen false || : 35 [ "$port" = "$RET" ] || db_fset noffle/port seen false || :
36 # write current port from inetd.conf into debconf db 36 # write current port from inetd.conf into debconf db
37 [ "$port" = "${port#\#}" ] && db_set noffle/port "$port" || : 37 [ "$port" = "${port#\#}" ] && db_set noffle/port "$port" || :
38 fi 38 fi
73 'via permanent connection') db_set noffle/fetchmode cron || :;; 73 'via permanent connection') db_set noffle/fetchmode cron || :;;
74 esac 74 esac
75 fi 75 fi
76 76
77 # read NOFFLE_FETCHMODE from $debian_config 77 # read NOFFLE_FETCHMODE from $debian_config
78 [ -s "$debian_config" ] && . $debian_config 78 [ -s "$debian_config" ] && . $debian_config || :
79 [ "$NOFFLE_FETCHMODE" != ppp -a "$NOFFLE_FETCHMODE" != cron ] && \ 79 if [ "$NOFFLE_FETCHMODE" != ppp -a "$NOFFLE_FETCHMODE" != cron ]; then
80 if [ -x /usr/sbin/pppd ]; then 80 if [ -x /usr/sbin/pppd ]; then
81 NOFFLE_FETCHMODE=ppp 81 NOFFLE_FETCHMODE=ppp
82 else 82 else
83 NOFFLE_FETCHMODE=cron 83 NOFFLE_FETCHMODE=cron
84 fi
84 fi 85 fi
85 # do we need confirmation? 86 # do we need confirmation?
86 db_get noffle/fetchmode || RET="" 87 db_get noffle/fetchmode || RET=""
87 [ "$NOFFLE_FETCHMODE" = "$RET" ] || db_fset noffle/fetchmode seen false || : 88 [ "$NOFFLE_FETCHMODE" = "$RET" ] || db_fset noffle/fetchmode seen false || :
88 89