diff options
author | David Härdeman <david@hardeman.nu> | 2020-07-12 12:13:18 +0200 |
---|---|---|
committer | David Härdeman <david@hardeman.nu> | 2020-07-12 12:13:18 +0200 |
commit | 17a4b90196fc366b302434a0646e521a3c8b33a0 (patch) | |
tree | 45b295ab814ac0c8556a50e687cd9918961c34e3 /debian/minecproxy.postinst | |
parent | 6db27716de7227fbd9c08a85d7ee9eeb38d17f74 (diff) |
Add some more fixes to Debian packaging
Diffstat (limited to 'debian/minecproxy.postinst')
-rw-r--r-- | debian/minecproxy.postinst | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/debian/minecproxy.postinst b/debian/minecproxy.postinst new file mode 100644 index 0000000..de176df --- /dev/null +++ b/debian/minecproxy.postinst @@ -0,0 +1,28 @@ +#!/bin/sh + +set -e + +case "$1" in +configure) + # Create minecproxy user (if not already done)... + adduser --system --group --home /var/lib/minecproxy \ + --quiet --gecos "Minecraft proxy daemon" minecproxy + + # ...create the directory (could've been removed during a purge + # but the user isn't, and adduser won't recreate the dir then)... + mkdir /var/lib/minecproxy > /dev/null 2>&1 || true + + # ...change traditional Unix permissions permissions... + chown minecproxy:minecproxy /var/lib/minecproxy + + # ...and restore SELinux context. + if which restorecon >/dev/null 2>&1; then + restorecon /var/lib/minecproxy + fi + + ;; +esac + +#DEBHELPER# + +exit 0 |