Your IP : 216.73.216.170


Current Path : /var/lib/dpkg/info/
Upload File :
Current File : //var/lib/dpkg/info/lynx-cur.postinst

#!/bin/sh
# postinst script for lynx-beta
pack=lynx-cur
cnfdir=/etc/${pack}
CONFIGFILE=${cnfdir}/local.cfg

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

# do not try managing $CONFIGfile if it exists, but is not a regular file
if test -f $CONFIGFILE && ! test -L $CONFIGFILE ; then

# Use debconf.
. /usr/share/debconf/confmodule

if [ ! -f $CONFIGFILE ] ; then
	cat << EOF > $CONFIGFILE
# local overides for lynx-cur configuration
STARTFILE:Not-Configured-Yet
EOF
	chmod 644 $CONFIGFILE
fi

cp -a $CONFIGFILE $CONFIGFILE.tmp

db_get ${pack}/defaulturl
# escape colons
defaulturl=`echo "$RET" | sed -e 's_:_\\\\:_g'`

# Check whether /etc/news/server exists and sync its value to NNTPSERVER setting:
if [ -e /etc/news/server ] ; then
	NNTPSERVER=`grep -s -v '^#' /etc/news/server | head -n 1`
fi

# add missing lines
test -z "$defaulturl"  || grep -Eq '^STARTFILE:' $CONFIGFILE || \
	echo "STARTFILE:Not-Configured-Yet" >> $CONFIGFILE
test -z "$NNTPSERVER" || grep -Eq '^NNTPSERVER:' $CONFIGFILE || \
	echo "NNTPSERVER:Not-Configured-Yet" >> $CONFIGFILE

sed -e "s:^STARTFILE\\:.*:STARTFILE\\:${defaulturl}:" \
	-e "s/^NNTPSERVER:.*/NNTPSERVER:${NNTPSERVER}/" \
	< $CONFIGFILE > $CONFIGFILE.tmp
mv -f $CONFIGFILE.tmp $CONFIGFILE

fi

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

# Automatically added by dh_installmenu
if [ "$1" = "configure" ] && [ -x "`which update-menus 2>/dev/null`" ]; then
	update-menus
fi
# End automatically added section
# Automatically added by dh_installmime
if [ "$1" = "configure" ] && [ -x "`which update-mime 2>/dev/null`" ]; then
	update-mime
fi
# End automatically added section


exit 0