aboutsummaryrefslogtreecommitdiff
path: root/debian/postinst
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2022-01-31 16:15:21 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2022-01-31 16:15:21 +0100
commit9f7b2c59e5f723557dff0ef20d0a372592bf1f0e (patch)
treef524e2c465237d539a2d6876c833dc9302be0b7b /debian/postinst
parenta758a5bd1195ba0b9f86d5c1fe9b2792ba064d45 (diff)
downloaddebian-edu-fai+itzks-9f7b2c59e5f723557dff0ef20d0a372592bf1f0e.tar.gz
debian-edu-fai+itzks-9f7b2c59e5f723557dff0ef20d0a372592bf1f0e.tar.bz2
debian-edu-fai+itzks-9f7b2c59e5f723557dff0ef20d0a372592bf1f0e.zip
debian/{postinst,postrm}: Create 'fai' system account during pkg:postinst.
Diffstat (limited to 'debian/postinst')
-rwxr-xr-xdebian/postinst45
1 files changed, 45 insertions, 0 deletions
diff --git a/debian/postinst b/debian/postinst
new file mode 100755
index 0000000..c434be5
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,45 @@
+#!/bin/sh
+# postinst script for debian-edu-fai
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postinst> `configure' <most-recently-configured-version>
+# * <old-postinst> `abort-upgrade' <new version>
+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+# <new-version>
+# * <postinst> `abort-remove'
+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+# <failed-install-package> <version> `removing'
+# <conflicting-package> <version>
+# for details, see https://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+case "${1}" in
+ 'configure')
+ ###
+ ### setup fai user account (needed for DLW keytab distribution)
+ ###
+
+ if ! getent 'passwd' 'fai' >'/dev/null'; then
+ echo 'Creating fai system user.' >&2
+ adduser --system --home /var/log/fai/client-logs \
+ --disabled-password --shell /bin/bash
+ fi
+ ;;
+ 'abort-upgrade'|'abort-remove'|'abort-deconfigure')
+ ;;
+ *)
+ echo "postinst called with unknown argument '${1}'" >&2
+ exit '1'
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit '0'