summaryrefslogtreecommitdiff
path: root/debian/taler-mdb.postinst
blob: c08fb2f4c99a984548f41b484a579477b478e419 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash

set -e

. /usr/share/debconf/confmodule

case "${1}" in
	configure)
		db_version 2.0

		db_get taler-mdb/autostart
		_AUTOSTART="${RET}" # boolean

		db_stop

cat > "/etc/systemd/system/taler-mdb.service" <<EOF
[Unit]
Description=GNU Taler Multi-Drop-Bus application

[Service]
EnvironmentFile=/etc/default/taler-mdb
User=root
Type=simple
Restart=on-failure
ExecStart=/usr/bin/taler-mdb -c /etc/taler-mdb.conf
EOF

        systemctl daemon-reload


		# Cleaning
		echo "All done."

		;;

	abort-upgrade|abort-remove|abort-deconfigure)

		;;

	*)
		echo "postinst called with unknown argument \`${1}'" >&2
		exit 1
		;;
esac

#DEBHELPER#

exit 0