File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ set -e
3+
4+ case " $1 " in
5+ configure)
6+ # Create fastrpc group via systemd-sysusers
7+ if command -v systemd-sysusers > /dev/null 2>&1 ; then
8+ systemd-sysusers /usr/lib/sysusers.d/fastrpc.conf || true
9+ fi
10+
11+ # Fallback in case systemd-sysusers is unavailable or failed
12+ if ! getent group fastrpc > /dev/null; then
13+ addgroup --system fastrpc
14+ fi
15+
16+ # Add target user to fastrpc group
17+ #
18+ # Do NOT use $USER directly here:
19+ # during package installation, $USER is usually root.
20+ #
21+ # If package is installed via sudo apt install ./xxx.deb,
22+ # SUDO_USER may contain the real invoking user.
23+ if [ -n " $SUDO_USER " ] && [ " $SUDO_USER " != " root" ]; then
24+ if getent passwd " $SUDO_USER " > /dev/null; then
25+ usermod -aG fastrpc " $SUDO_USER " || true
26+ fi
27+ fi
28+ ;;
29+ esac
30+
31+ # DEBHELPER#
32+
33+ exit 0
You can’t perform that action at this time.
0 commit comments