#! /bin/sh # postinst script for Gwsetup # set -e # These will be used here and there below RCFILE=/etc/default/gwsetup INITFILE=/etc/init.d/gwsetup # We we'll need some variables defined there # We first define some defaults values...just in case USERS_GROUP=geneweb GENEWEBUSER=geneweb LOGFILE=/var/log/gwsetup.log # Default settings DEFAULTPORT=2316 DEFAULTRUNMODE="Always on" # Reads config file (will override defaults above) [ -r $RCFILE ] && . $RCFILE . /usr/share/debconf/confmodule db_version 2.0 write_rcfile() { cat >$RCFILE </dev/null then echo "Adding $GENEWEBUSER user ... " adduser --quiet --system --home /var/lib/geneweb --no-create-home --ingroup $USERS_GROUP $GENEWEBUSER fi # Permissions and groups changes come back # to the configure stage again. # Problems may remains if users previously messed up # the permissions...but more huge problems will # occur if this stage occurs _before_ the geneweb # group creation (was bug 171570 on 4.07-3 release) if [ ! -f $LOGFILE ] then touch $LOGFILE fi # The log file is written by gwsetup running as the geneweb user # Make it readable/writable by this user only chown $GENEWEBUSER:$USERS_GROUP $LOGFILE chmod 600 $LOGFILE # Values are read from debconf # to update variables get_debconf # The settings file is written # Moved to postinst write_rcfile ;; *) ;; esac #DEBHELPER#