hyun.psd; gzuncompress
|
Server IP : 173.236.192.202 / Your IP : 216.73.216.85 Web Server : Apache System : Linux iad1-shared-e1-03 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64 User : andfor18 ( 14551322) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /usr/lib/sysuser-helper/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] | [ Lock Shell ] | [ Logout ] |
|---|
#!/bin/sh
set -eu
exec >/dev/null # only errors should pass.
command="${1}" ; shift
case "${command}" in
postinst)
if ! getent passwd "$CONF_USERNAME" ; then
emptydir=$(mktemp -d) # to inhibit /etc/skel
set -- --system --shell /usr/sbin/nologin
# Create a home directory for a system user, unless it is
# /nonexistent, which must stay nonexistent.
if [ "${CONF_HOME}" != '/nonexistent' ] ; then
set -- "$@" --create-home --skel "${emptydir}" --home-dir "${CONF_HOME}"
fi
useradd "$@" "${CONF_USERNAME}"
rmdir "${emptydir}"
fi
usermod "${CONF_USERNAME}" -c "Created by dh-sysuser for ${CONF_PACKAGE}"
# If the user already has another home directory, we use `usermod
# --move-home'. Unfortunately, a new home is required to be
# non-existent (and different from previous), so this
# condition is required.
if [ ! -d "$CONF_HOME" ] ; then
usermod --move-home --home "$CONF_HOME" "$CONF_USERNAME"
fi
;;
prerm)
#no-op, to avoid transition 1.3.5 --> 1.4; to be removed when nothing is build with dh-sysuser < 1.4
#1.4 moves purge logic from prerm to postrm, but packages builded with dh-sysuser < 1.4 will still call
#syuser-helper in prerm and not in postrm
;;
postrm)
# Transition from dh-sysuser=1.3. It did not pass mainainer
# script arguments to sysuser-helper.
case ${1:-} in
purge|abort-install)
if [ "${CONF_HOME}" != '/nonexistent' ] ; then
rmdir --ignore-fail-on-non-empty "${CONF_HOME}"
fi
if ! [ -d "${CONF_HOME}" ] ; then
if ! userdel --force "${CONF_USERNAME}" ; then
echo >&2 "warning: failed to remove ${CONF_USERNAME}. Proceeding anyway."
fi
fi
esac
esac