summaryrefslogtreecommitdiff
path: root/debian/taler-exchange-offline.postinst
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-07-26 14:18:02 +0200
committerFlorian Dold <florian@dold.me>2021-07-26 14:18:02 +0200
commit5430dc34180e1c72c9a09f9eb17c2999e426bf77 (patch)
treedd5f153937c98d888f39220a669f608a26c34b84 /debian/taler-exchange-offline.postinst
parenta06a6a22ea01020c8c02434a3e0caa59a5bb0dd8 (diff)
downloadexchange-5430dc34180e1c72c9a09f9eb17c2999e426bf77.tar.gz
exchange-5430dc34180e1c72c9a09f9eb17c2999e426bf77.tar.bz2
exchange-5430dc34180e1c72c9a09f9eb17c2999e426bf77.zip
debian: revise maintainer scripts and service files
Diffstat (limited to 'debian/taler-exchange-offline.postinst')
-rw-r--r--debian/taler-exchange-offline.postinst42
1 files changed, 42 insertions, 0 deletions
diff --git a/debian/taler-exchange-offline.postinst b/debian/taler-exchange-offline.postinst
new file mode 100644
index 000000000..125afbc5b
--- /dev/null
+++ b/debian/taler-exchange-offline.postinst
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+TALEROFF_HOME="/var/lib/taler-exchange-offline"
+
+# usage: lncfg user home target
+function lncfg() {
+ local cf=$TALER_HOME/$2/.config
+ if [ ! -e $cf ]; then
+ mkdir $cf
+ chown $(stat -L -c %u $TALER_HOME/$2):$(stat -L -c %g $TALER_HOME/$2) $cf
+ fi
+ ln -sf $3 $cf/taler.conf
+}
+
+case "${1}" in
+configure)
+
+ addgroup --quiet --system taler-exchange-offline
+
+ adduser --quiet --system --ingroup taler-exchange-offline --home ${TALEROFF_HOME}/httpd taler-exchange-offline
+
+ lncfg taler-exchange-offline taler-exchange-offline /etc/taler/exchange-offline.conf
+
+ # Cleaning
+ echo "All done."
+ ;;
+
+abort-upgrade | abort-remove | abort-deconfigure) ;;
+
+*)
+ echo "postinst called with unknown argument \`${1}'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0