1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
#!/bin/sh
# postinst script for lynx-beta
pack=lynx-cur
cnfdir=/etc/${pack}
set -e
if [ "$1" != configure ]; then exit 0; fi
update-alternatives --install /usr/bin/www-browser www-browser \
/usr/bin/lynx.cur 40 \
--slave /usr/share/man/man1/www-browser.1.gz www-browser.1.gz \
/usr/share/man/man1/lynx.cur.1.gz
update-alternatives --install /usr/bin/lynx lynx /usr/bin/lynx.cur 15 \
--slave /usr/share/man/man1/lynx.1.gz lynx.1.gz \
/usr/share/man/man1/lynx.cur.1.gz
# First, setup local.cfg
if [ ! -f ${cnfdir}/local.cfg ] ; then
cp /usr/share/doc/${pack}/local.cfg.in ${cnfdir}/local.cfg
fi
# Use debconf.
. /usr/share/debconf/confmodule
LINE1=`fgrep -n "STARTFILE:Not-Configured-Yet" \
${cnfdir}/local.cfg | awk -F: '{print $1;}'`
if [ ! -z "$LINE1" ]; then
db_get ${pack}/defaulturl
URL=`echo "$RET" | sed -e 's|:|\\\\:|g'`
sed -e "$LINE1 s:Not-Configured-Yet:$URL:" ${cnfdir}/local.cfg \
> ${cnfdir}/local.cfg-$$-1 && mv -f ${cnfdir}/local.cfg-$$-1 ${cnfdir}/local.cfg
fi
LINE2=`fgrep -n "#NNTPSERVER:news.server.dom" \
${cnfdir}/local.cfg | awk -F: '{print $1;}'`
if [ ! -z "$LINE2" ]; then
NNTPSERVER=`grep -s -v '^#' /etc/news/server | head -n 1`;
if [ -n "$NNTPSERVER" ]; then
sed -e "$LINE2 s/#NNTPSERVER:news.server.dom/NNTPSERVER:$NNTPSERVER/" ${cnfdir}/local.cfg \
> ${cnfdir}/local.cfg-$$-2 && mv -f ${cnfdir}/local.cfg-$$-2 ${cnfdir}/local.cfg
fi
fi
if [ -f ${cnfdir}/local.cfg-$$-[12] ]; then
rm -f ${cnfdir}/local.cfg-$$-[12]
fi
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
|