#!/bin/sh -e PKG=`basename $0 | sed -e 's/\.[^.]*$//'` CFG=/etc/${PKG}.conf FreeBSetOption() { mv ${CFG} ${CFG}~ cat ${CFG}~ | \ perl -ne "\$flag=0; do { if ( \$flag==1 && /(^[^#^;]*$2\s+=\s+)\w+/ ) { print \"\$1$3\\n\"; \$flag = 0 ; next ;} ; if ( /$1/ ) { \$flag=1; } print ; } while ( <> ) ; " > ${CFG} rm ${CFG}~ } . /usr/share/debconf/confmodule db_get ${PKG}/clienturl FreeBSetOption client url $RET db_get ${PKG}/clientusername FreeBSetOption client username $RET db_get ${PKG}/clientpassword FreeBSetOption client password $RET db_get ${PKG}/mcsiusername FreeBSetOption mcsi username $RET db_get ${PKG}/mcsipassword FreeBSetOption mcsi password $RET # Make new config file only readable for root because it contains passwords chmod 600 ${CFG} # make /var/lib/freeb/public accessible for www-data user chown www-data /var/lib/freeb/public #DEBHELPER#