summaryrefslogtreecommitdiffstats
path: root/debian/libuuid1.postinst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:49:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:49:26 +0000
commit668f05d989d214c0a5201bc51982e932ff15f6a3 (patch)
tree31067fca0cd63c2a0fb2bd85798e5cb2ef0dec49 /debian/libuuid1.postinst
parentAdding upstream version 1.47.0. (diff)
downloade2fsprogs-debian/1.47.0-2.tar.xz
e2fsprogs-debian/1.47.0-2.zip
Adding debian version 1.47.0-2.debian/1.47.0-2debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/libuuid1.postinst')
-rw-r--r--debian/libuuid1.postinst40
1 files changed, 40 insertions, 0 deletions
diff --git a/debian/libuuid1.postinst b/debian/libuuid1.postinst
new file mode 100644
index 0000000..5336fcf
--- /dev/null
+++ b/debian/libuuid1.postinst
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+set -e
+
+ADDUSERCONF='/etc/adduser.conf'
+
+if test -f $ADDUSERCONF; then
+ FIRST_SYSTEM_UID=$(sed -n "s/^[[:space:]]*FIRST_SYSTEM_UID[[:space:]]*=[[:space:]]*[\"']\?\([^\"']*\)[\"']\?/\1/p" $ADDUSERCONF)
+ LAST_SYSTEM_UID=$(sed -n "s/^[[:space:]]*LAST_SYSTEM_UID[[:space:]]*=[[:space:]]*[\"']\?\([^\"']*\)[\"']\?/\1/p" $ADDUSERCONF)
+ FIRST_SYSTEM_GID=$(sed -n "s/^[[:space:]]*FIRST_SYSTEM_GID[[:space:]]*=[[:space:]]*[\"']\?\([^\"']*\)[\"']\?/\1/p" $ADDUSERCONF)
+ LAST_SYSTEM_GID=$(sed -n "s/^[[:space:]]*LAST_SYSTEM_GID[[:space:]]*=[[:space:]]*[\"']\?\([^\"']*\)[\"']\?/\1/p" $ADDUSERCONF)
+fi
+
+if test -z "$FIRST_SYSTEM_UID"; then
+ FIRST_SYSTEM_UID=100
+fi
+if test -z "$LAST_SYSTEM_UID"; then
+ LAST_SYSTEM_UID=999
+fi
+if test -z "$FIRST_SYSTEM_GID"; then
+ FIRST_SYSTEM_GID=100
+fi
+if test -z "$LAST_SYSTEM_GID"; then
+ LAST_SYSTEM_GID=999
+fi
+
+if ! getent group | grep -q libuuid; then
+ groupadd -f -K GID_MIN=$FIRST_SYSTEM_GID -K GID_MAX=$LAST_SYSTEM_GID libuuid
+fi
+if ! getent passwd | grep -q libuuid; then
+ useradd -d /var/lib/libuuid -K UID_MIN=$FIRST_SYSTEM_UID -K UID_MAX=$LAST_SYSTEM_UID -g libuuid libuuid
+fi
+
+mkdir -p /var/lib/libuuid
+chown libuuid:libuuid /var/lib/libuuid
+chmod 2775 /var/lib/libuuid
+
+#DEBHELPER#
+
+exit 0