#!/bin/sh # postinst script for x2gothinclient-chroot # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see https://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in configure) ### ### setup X2Go user account (needed for session database) ### # setup x2gothinclient user and group if ! getent group x2gothinclient >/dev/null; then echo "Creating x2gothinclient group." >&2 addgroup --system x2gothinclient else echo "Group x2gothinclient already exists." >&2 fi if ! getent passwd x2gothinclient >/dev/null; then echo "Creating x2gothinclient user." >&2 adduser --system \ --disabled-password --disabled-login \ --shell /bin/bash --group --home /var/lib/x2gothinclient x2gothinclient # make sure the home directory belongs to x2gothinclient:x2gothinclient chown x2gothinclient:x2gothinclient /var/lib/x2gothinclient -Rf # make sure the x2gothinclient user is in its appropriate groups if getent group audio 1>/dev/null; then adduser x2gothinclient audio; fi if getent group audio 1>/dev/null; then if getent passwd pulse 1>/dev/null; then adduser pulse audio; fi; fi if getent group pulse 1>/dev/null; then adduser x2gothinclient pulse; fi if getent group cdrom 1>/dev/null; then adduser x2gothinclient cdrom; fi if getent group plugdev 1>/dev/null; then adduser x2gothinclient plugdev; fi if ! getent group scard 1>/dev/null; then groupadd --system scard; fi if getent group scard 1>/dev/null; then adduser x2gothinclient scard; fi else echo "User x2gothinclient already exists." >&2 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. exit 0