Package list metche / debian/1.0-1 debian / postinst
debian/1.0-1

Tree @debian/1.0-1 (Download .tar.gz)

postinst @debian/1.0-1raw · 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

#DEBHELPER#