xbps-triggers: fixed the system-accounts trigger, bump to 0.13.

This commit is contained in:
Juan RP 2010-12-28 13:03:04 +01:00
parent 9317ea447b
commit 986f18faa1
2 changed files with 9 additions and 9 deletions

View File

@ -51,6 +51,11 @@ run)
case "$TARGET" in case "$TARGET" in
post-install) post-install)
# System groups required by a package.
for grp in ${system_groups}; do
group_add $grp
done
# System user/group required by a package. # System user/group required by a package.
for acct in ${system_accounts}; do for acct in ${system_accounts}; do
eval homedir="\$${acct}_homedir" eval homedir="\$${acct}_homedir"
@ -60,13 +65,13 @@ run)
[ -z "$homedir" ] && homedir="/" [ -z "$homedir" ] && homedir="/"
[ -z "$shell" ] && shell="/sbin/nologin" [ -z "$shell" ] && shell="/sbin/nologin"
[ -z "$descr" ] && descr="$acct unpriviledged user" [ -z "$descr" ] && descr="$acct unpriviledged user"
[ -n "$groups" ] && groups="-G $groups" [ -n "$groups" ] && user_groups="-G $groups"
group_add $groups group_add $acct
if ! $GETENT passwd ${acct} >/dev/null; then if ! $GETENT passwd ${acct} >/dev/null; then
$USERADD -c "$descr" -d "$homedir" \ $USERADD -c "$descr" -d "$homedir" \
-s "$shell" -g ${acct} $groups \ -s "$shell" -g ${acct} $user_groups \
-r ${acct} && \ -r ${acct} && \
$PASSWD -l ${acct} >/dev/null 2>&1 $PASSWD -l ${acct} >/dev/null 2>&1
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
@ -77,11 +82,6 @@ run)
fi fi
fi fi
done done
# System groups required by a package.
for grp in ${system_groups}; do
group_add $grp
done
;; ;;
pre-remove) pre-remove)
# #

View File

@ -1,6 +1,6 @@
# Template file for 'xbps-triggers' # Template file for 'xbps-triggers'
pkgname=xbps-triggers pkgname=xbps-triggers
version=0.13 version=0.14
build_style=custom-install build_style=custom-install
short_desc="XBPS triggers" short_desc="XBPS triggers"
maintainer="Juan RP <xtraeme@gmail.com>" maintainer="Juan RP <xtraeme@gmail.com>"