2020-12-28 11:39:05 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
. /usr/share/debconf/confmodule
|
|
|
|
|
2021-07-29 20:55:04 +02:00
|
|
|
TALER_HOME="/var/lib/taler"
|
2021-07-26 14:18:02 +02:00
|
|
|
_GROUPNAME=taler-exchange-secmod
|
|
|
|
_DBGROUPNAME=taler-exchange-db
|
|
|
|
_EUSERNAME=taler-exchange-httpd
|
2021-07-27 16:53:02 +02:00
|
|
|
_CLOSERUSERNAME=taler-exchange-closer
|
2022-02-22 13:29:52 +01:00
|
|
|
_CSECUSERNAME=taler-exchange-secmod-cs
|
2021-07-26 14:18:02 +02:00
|
|
|
_RSECUSERNAME=taler-exchange-secmod-rsa
|
2021-07-26 19:04:50 +02:00
|
|
|
_ESECUSERNAME=taler-exchange-secmod-eddsa
|
2021-07-26 14:18:02 +02:00
|
|
|
_AGGRUSERNAME=taler-exchange-aggregator
|
|
|
|
_WIREUSERNAME=taler-exchange-wire
|
2021-07-16 17:31:19 +02:00
|
|
|
|
2020-12-28 11:39:05 +01:00
|
|
|
case "${1}" in
|
2021-07-16 17:16:38 +02:00
|
|
|
configure)
|
|
|
|
|
2021-07-26 14:18:02 +02:00
|
|
|
# Create taler groups as needed
|
2021-07-16 17:16:38 +02:00
|
|
|
if ! getent group ${_GROUPNAME} >/dev/null; then
|
|
|
|
addgroup --quiet --system ${_GROUPNAME}
|
|
|
|
fi
|
|
|
|
if ! getent group ${_DBGROUPNAME} >/dev/null; then
|
|
|
|
addgroup --quiet --system ${_DBGROUPNAME}
|
|
|
|
fi
|
|
|
|
|
2021-07-26 14:18:02 +02:00
|
|
|
# Create taler users if needed
|
2021-07-16 17:16:38 +02:00
|
|
|
if ! getent passwd ${_EUSERNAME} >/dev/null; then
|
2021-07-29 20:55:04 +02:00
|
|
|
adduser --quiet --system --no-create-home --ingroup ${_GROUPNAME} --home ${TALER_HOME} ${_EUSERNAME}
|
2021-07-26 19:04:50 +02:00
|
|
|
adduser --quiet ${_EUSERNAME} ${_DBGROUPNAME}
|
2023-03-05 01:18:08 +01:00
|
|
|
adduser --quiet ${_EUSERNAME} ${_GROUPNAME}
|
2021-07-16 17:16:38 +02:00
|
|
|
fi
|
|
|
|
if ! getent passwd ${_RSECUSERNAME} >/dev/null; then
|
2021-07-29 20:55:04 +02:00
|
|
|
adduser --quiet --system --no-create-home --ingroup ${_GROUPNAME} --home ${TALER_HOME} ${_RSECUSERNAME}
|
2021-07-16 17:16:38 +02:00
|
|
|
fi
|
2022-02-22 13:29:52 +01:00
|
|
|
if ! getent passwd ${_CSECUSERNAME} >/dev/null; then
|
|
|
|
adduser --quiet --system --no-create-home --ingroup ${_GROUPNAME} --home ${TALER_HOME} ${_CSECUSERNAME}
|
|
|
|
fi
|
2021-07-16 17:16:38 +02:00
|
|
|
if ! getent passwd ${_ESECUSERNAME} >/dev/null; then
|
2021-07-29 20:55:04 +02:00
|
|
|
adduser --quiet --system --no-create-home --ingroup ${_GROUPNAME} --home ${TALER_HOME} ${_ESECUSERNAME}
|
2021-07-16 17:16:38 +02:00
|
|
|
fi
|
|
|
|
if ! getent passwd ${_WIREUSERNAME} >/dev/null; then
|
2021-07-29 20:55:04 +02:00
|
|
|
adduser --quiet --system --no-create-home --home ${TALER_HOME} ${_WIREUSERNAME}
|
2021-07-16 17:16:38 +02:00
|
|
|
adduser --quiet ${_WIREUSERNAME} ${_DBGROUPNAME}
|
|
|
|
fi
|
2021-07-27 16:53:02 +02:00
|
|
|
if ! getent passwd ${_CLOSERUSERNAME} >/dev/null; then
|
2021-07-29 20:55:04 +02:00
|
|
|
adduser --quiet --system --no-create-home --home ${TALER_HOME} ${_CLOSERUSERNAME}
|
2021-07-27 16:53:02 +02:00
|
|
|
adduser --quiet ${_CLOSERUSERNAME} ${_DBGROUPNAME}
|
|
|
|
fi
|
2021-07-16 17:16:38 +02:00
|
|
|
if ! getent passwd ${_AGGRUSERNAME} >/dev/null; then
|
2021-07-29 20:55:04 +02:00
|
|
|
adduser --quiet --system --no-create-home --home ${TALER_HOME} ${_AGGRUSERNAME}
|
2021-07-16 17:16:38 +02:00
|
|
|
adduser --quiet ${_AGGRUSERNAME} ${_DBGROUPNAME}
|
|
|
|
fi
|
|
|
|
|
2023-03-04 23:33:11 +01:00
|
|
|
if ! dpkg-statoverride --list /etc/taler/secrets/exchange-accountcredentials-1.secret.conf >/dev/null 2>&1; then
|
2021-07-29 15:27:54 +02:00
|
|
|
dpkg-statoverride --add --update \
|
|
|
|
${_WIREUSERNAME} root 460 \
|
2023-03-04 23:33:11 +01:00
|
|
|
/etc/taler/secrets/exchange-accountcredentials-1.secret.conf
|
2021-07-29 15:27:54 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
if ! dpkg-statoverride --list /etc/taler/secrets/exchange-db.secret.conf >/dev/null 2>&1; then
|
|
|
|
dpkg-statoverride --add --update \
|
|
|
|
root ${_DBGROUPNAME} 660 \
|
|
|
|
/etc/taler/secrets/exchange-db.secret.conf
|
|
|
|
fi
|
2021-01-02 14:05:45 +01:00
|
|
|
|
2021-07-16 17:16:38 +02:00
|
|
|
;;
|
2020-12-28 11:39:05 +01:00
|
|
|
|
2021-07-16 17:16:38 +02:00
|
|
|
abort-upgrade | abort-remove | abort-deconfigure) ;;
|
2020-12-28 11:39:05 +01:00
|
|
|
|
2021-07-16 17:16:38 +02:00
|
|
|
*)
|
|
|
|
echo "postinst called with unknown argument \`${1}'" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
2020-12-28 11:39:05 +01:00
|
|
|
esac
|
|
|
|
|
|
|
|
#DEBHELPER#
|
|
|
|
|
|
|
|
exit 0
|