2014-01-25 04:21:40 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
#DEBHELPER#
|
|
|
|
|
|
|
|
# Source debconf library.
|
|
|
|
. /usr/share/debconf/confmodule
|
|
|
|
|
|
|
|
# Configuration
|
|
|
|
HOSTNAME="`hostname`"
|
|
|
|
ROOT=/var/gopher
|
|
|
|
PACKAGE=gophernicus
|
|
|
|
LOGDIR=/var/log/$PACKAGE
|
|
|
|
LIBDIR=/usr/lib/$PACKAGE
|
|
|
|
BINARY=in.gophernicus
|
|
|
|
USER=nobody
|
|
|
|
|
|
|
|
# Get hostname from debconf
|
|
|
|
db_get gophernicus/fqdn
|
|
|
|
if [ "$RET" ]; then
|
|
|
|
HOSTNAME="`echo $RET | tr -cd 'A-Za-z0-9.-'`"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Configure gophernicus
|
|
|
|
if [ "$1" = "configure" ]; then
|
|
|
|
if [ ! -f "$ROOT/gophermap" ]; then
|
|
|
|
cp $LIBDIR/gophermap $ROOT/
|
|
|
|
fi
|
|
|
|
|
|
|
|
chown $USER.adm $LOGDIR
|
|
|
|
chmod 0750 $LOGDIR
|
|
|
|
|
2016-09-08 10:06:23 -04:00
|
|
|
#update-inetd --add "gopher\t\tstream\ttcp\tnowait\t$USER\t/usr/sbin/$BINARY\t$BINARY -h $HOSTNAME -l $LOGDIR/server.log -f /usr/lib/$PACKAGE/filters"
|
2014-01-25 04:21:40 -05:00
|
|
|
fi
|
|
|
|
|