| Current Path : /proc/8644/root/proc/self/root/var/lib/dpkg/info/ |
| Current File : //proc/8644/root/proc/self/root/var/lib/dpkg/info/lynx-cur.config |
#!/bin/sh -e
CONFIGFILE=/etc/lynx-cur/local.cfg
# Use debconf.
. /usr/share/debconf/confmodule
# Establish the preliminaries.
db_version
db_title 'Lynx-cur Configuration'
if [ -e $CONFIGFILE ]; then
# parse configfile
if grep -q '^STARTFILE:' $CONFIGFILE ; then
defaulturl=`sed -n '/^STARTFILE:/{s/^STARTFILE://p}' < $CONFIGFILE`
# Store values from config file into debconf_db
db_set lynx-cur/defaulturl "$defaulturl"
fi
else
#set a sane default value if no preconfiguration has yet happened
# (either by preseeding debconf or by pre-generating local.cfg
db_fget lynx-cur/defaulturl seen
if [ "$RET" = false ]; then
if [ ! -z "`dnsdomainname`" ]; then
db_set lynx-cur/defaulturl "http://www.`dnsdomainname`/"
else
db_reset lynx-cur/defaulturl
fi
fi
fi
ok=''
while [ -z "$ok" ]; do
# Ask the user what url should be displayed by default.
db_input low lynx-cur/defaulturl || true
db_go || true
# Do some syntax checking on the url and see if it's ok.
db_get lynx-cur/defaulturl
case "$RET" in
http:*|ftp:*|news:*|nntp:*|gopher:*|file:*|/*)
ok=1
;;
*)
# Set default flag so the user is prompted again.
db_fset lynx-cur/defaulturl seen false
;;
esac
done
## # Important note to a user
## if [ -f /etc/lynx.cfg ]; then
## db_input high lynx-cur/etc_lynx.cfg || true
## db_go || true
## fi
# vim:tabstop=4:expandtab:shiftwidth=4