2021-01-03 23:29:27 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
. /usr/share/debconf/confmodule
|
|
|
|
|
2021-07-26 14:18:02 +02:00
|
|
|
CONFIG_FILE="/etc/default/taler-auditor"
|
|
|
|
TALER_HOME="/var/lib/taler-auditor"
|
|
|
|
_USERNAME=taler-auditor-httpd
|
|
|
|
_GROUPNAME=taler-auditor-httpd
|
2021-01-03 23:29:27 +01:00
|
|
|
|
2021-07-26 14:18:02 +02:00
|
|
|
case "${1}" in
|
|
|
|
configure)
|
|
|
|
# Creating taler groups as needed
|
|
|
|
if ! getent group ${_GROUPNAME} >/dev/null; then
|
|
|
|
addgroup --quiet --system ${_GROUPNAME}
|
|
|
|
fi
|
|
|
|
# Creating taler users if needed
|
|
|
|
if ! getent passwd ${_USERNAME} >/dev/null; then
|
2021-07-31 13:18:05 +02:00
|
|
|
adduser --quiet --system --ingroup ${_GROUPNAME} --no-create-home --home ${TALER_HOME} ${_USERNAME}
|
2021-07-26 14:18:02 +02:00
|
|
|
fi
|
|
|
|
|
2021-07-29 15:27:54 +02:00
|
|
|
if ! dpkg-statoverride --list /etc/taler/secrets/auditor-db.secret.conf >/dev/null 2>&1; then
|
|
|
|
dpkg-statoverride --add --update \
|
|
|
|
${_USERNAME} ${_GROUPNAME} 660 \
|
|
|
|
/etc/taler/secrets/auditor-db.secret.conf
|
|
|
|
fi
|
2021-07-29 15:19:56 +02:00
|
|
|
|
2021-07-26 14:18:02 +02:00
|
|
|
;;
|
|
|
|
|
|
|
|
abort-upgrade | abort-remove | abort-deconfigure) ;;
|
|
|
|
*)
|
|
|
|
echo "postinst called with unknown argument \`${1}'" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
2021-01-03 23:29:27 +01:00
|
|
|
esac
|
|
|
|
|
|
|
|
#DEBHELPER#
|
|
|
|
|
|
|
|
exit 0
|