Modify the INSTALL/REMOVE scripts to use predef vars and unneeded chroot calls.

--HG--
extra : convert_revision : dfd737c502bea327054ecff5bc1fa152db6e2009
This commit is contained in:
Juan RP
2009-04-08 03:24:57 +02:00
parent 201be83c73
commit acd07f61e3
8 changed files with 44 additions and 44 deletions

View File

@@ -2,21 +2,21 @@
# This script creates the HAL system user/group.
#
case "$2" in
case "${ACTION}" in
pre)
;;
post)
echo "Running $3-$4 post installation hooks..."
if ! chroot . getent group hal >/dev/null; then
chroot . groupadd -r hal
echo "Running ${PKGNAME}-${VERSION} post installation hooks..."
if ! getent group hal >/dev/null; then
groupadd -r hal 2>&1 >/dev/null
[ $? -ne 0 ] && exit $?
echo "Created HAL system group."
fi
if ! chroot . getent passwd hal >/dev/null; then
chroot . useradd -c "HAL daemon" \
if ! getent passwd hal >/dev/null; then
useradd -c "HAL daemon" \
-d / -s /sbin/nologin -g hal \
-G optical,floppy,storage -r hal && \
chroot . passwd -l hal &>/dev/null
passwd -l hal 2>&1 >/dev/null
[ $? -ne 0 ] && exit $?
echo "Created HAL system user."
fi