2009-03-23 07:38:24 +00:00
|
|
|
#
|
|
|
|
# This script creates the HAL system user/group.
|
|
|
|
#
|
|
|
|
|
2009-04-08 01:24:57 +00:00
|
|
|
case "${ACTION}" in
|
2009-03-23 07:38:24 +00:00
|
|
|
pre)
|
|
|
|
;;
|
|
|
|
post)
|
2009-04-08 01:24:57 +00:00
|
|
|
echo "Running ${PKGNAME}-${VERSION} post installation hooks..."
|
|
|
|
if ! getent group hal >/dev/null; then
|
|
|
|
groupadd -r hal 2>&1 >/dev/null
|
2009-03-23 07:38:24 +00:00
|
|
|
[ $? -ne 0 ] && exit $?
|
|
|
|
echo "Created HAL system group."
|
|
|
|
fi
|
2009-04-08 01:24:57 +00:00
|
|
|
if ! getent passwd hal >/dev/null; then
|
|
|
|
useradd -c "HAL daemon" \
|
2009-03-23 07:38:24 +00:00
|
|
|
-d / -s /sbin/nologin -g hal \
|
|
|
|
-G optical,floppy,storage -r hal && \
|
2009-04-08 01:24:57 +00:00
|
|
|
passwd -l hal 2>&1 >/dev/null
|
2009-03-23 07:38:24 +00:00
|
|
|
[ $? -ne 0 ] && exit $?
|
|
|
|
echo "Created HAL system user."
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|