#!/bin/sh set -e . /usr/share/debconf/confmodule db_version 2.0 # Load in defaults file if it exists, and use it to set defaults of debconf # questions. if [ -f /etc/default/slrn ]; then . /etc/default/slrn || true fi if [ ! -z "$GETDESCS" ]; then db_set slrn/getdescs "$GETDESCS" fi db_beginblock # Note this code block is duplicated in slrnpull's config script. if [ ! -s /etc/news/server ]; then # No news server file currently exists (or it's empty). db_get shared/news/server SERVER="$RET" # If there is no server set, try to guess a good value. if [ -z "$SERVER" ]; then NETNAME="`hostname -d`" || true if [ ! -z "$NETNAME" ]; then db_set shared/news/server "news.$NETNAME" fi fi else # Reconfiguring the package, or a news server file already exists. # Still ask the question, though it may or may not be seen. Just # use the first line of the file now as the default answer. db_set shared/news/server "`head -n 1 /etc/news/server`" # Effectively, the question is seen -- since the file is set up.. db_fset shared/news/server seen true fi db_input medium shared/news/server || true if [ ! -s /etc/mailname ]; then # No /etc/mailname file, or it's empty, so prompt for the mailname. db_get shared/mailname MAILNAME="$RET" if [ -z "$MAILNAME" ]; then db_set shared/mailname "`hostname --fqdn`" || db_set shared/mailname "`hostname`" fi else # Reconfiguring the package, or a mailname file already exists. # Still ask the question, though it may not be seen. Just use the # first line of the file now as the default answer. db_set shared/mailname "`head -n 1 /etc/mailname`" # Effectively, the question is seen -- since the file is set up.. db_fset shared/mailname seen true fi db_input medium shared/mailname || true db_input low slrn/getdescs || true if [ ! -f /var/lib/slrn/newsgroups.dsc ]; then db_input low slrn/getdescs_now || true else db_set slrn/getdescs_now false fi db_endblock db_go || true