valet/debian/aic-valet-core.preinst
Omar Rivera 285e4297df Adding packaging and debian instructions
Creates 2 debian packages from source.
    aic-valet-core (main pkg: API, engine)
    aic-valet-openstack-plugins (heat lifecycle plugin, nova scheduler filter)

Change-Id: I473ca046c432cd3383388987e1fe7e5a737e8ddb
2017-08-16 14:02:15 -05:00

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