Package list metche / 4c9604c debian / postinst
4c9604c

Tree @4c9604c (Download .tar.gz)

postinst @4c9604craw · history · blame

#!/bin/sh

CONFIGFILE=/etc/metche.conf
set -e
. /usr/share/debconf/confmodule

cp -a -f $CONFIGFILE $CONFIGFILE.tmp

db_get metche/email
EMAIL_ADDRESS="$RET"
sed -e "s/^ *EMAIL_ADDRESS=.*/EMAIL_ADDRESS=\"$EMAIL_ADDRESS\"/" -i $CONFIGFILE.tmp

db_get metche/changelog/type
case "$RET" in
"Single changelog file")
    db_get metche/changelog/file
    CHANGELOG_FILE="$RET"
    sed -e "s@^[# ]*CHANGELOG_FILE=.*@CHANGELOG_FILE=\"$CHANGELOG_FILE\"@" \
	-e "s@^[# ]*CHANGELOG_DIR@#CHANGELOG_DIR@" -i $CONFIGFILE.tmp
  ;;
"Multiple changelog files")
    db_get metche/changelog/directory
    CHANGELOG_DIR="$RET"
    sed -e "s@^[# ]*CHANGELOG_DIR=.*@CHANGELOG_DIR=\"$CHANGELOG_DIR\"@" \
	-e "s@^[# ]*CHANGELOG_FILE@#CHANGELOG_FILE@" -i $CONFIGFILE.tmp
  ;;
"No changelog monitoring")
    sed -e "s@^[# ]*CHANGELOG_FILE@#CHANGELOG_FILE@" \
        -e "s@^[# ]*CHANGELOG_DIR@#CHANGELOG_DIR@" -i $CONFIGFILE.tmp
  ;;
esac

mv -f $CONFIGFILE.tmp $CONFIGFILE

metche cron