valet/debian/aic-valet-core.preinst

48 lines
947 B
Bash

#!/bin/sh
set -e
case "$1" in
install|upgrade)
# create the valet group
if ! getent group valet > /dev/null 2>&1
then
addgroup --system valet >/dev/null
fi
# create the valet user to avoid running as root
if ! getent passwd valet > /dev/null 2>&1
then
adduser --quiet \
--system \
--home /var/lib/valet \
--no-create-home \
--ingroup valet \
--shell /bin/false \
valet
fi
if [ "$(id -gn valet)" = "nogroup" ]
then
usermod -g valet valet
fi
;;
configure)
;;
abort-upgrade)
;;
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 0
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0