#!/bin/sh # ------- # do some tests LLXCFG_VARS="CAP_ZERO_CAPNAME LDAP_ZERO_CAPNAME" eval "$(llxcfg-showvars $LLXCFG_VARS)" CAPNAME="$CAP_ZERO_CAPNAME" if [ "$LDAP_ZERO_CAPNAME" ]; then CAPNAME="$LDAP_ZERO_CAPNAME" fi [ "$CAPNAME" ] || exit 0 case "$1" in add | del) if [ "$USER_HOMEDIR" ]; then lliurex-cap sync-with-rconflict "${CAPNAME}" data "$USER_HOMEDIR" fi ;; addgroup | delgroup ) [ "$NETGROUP_DIR" ] || exit 0 [ "$GROUP_DIRECTORY" ] || exit 0 [ "$USER_NAME" ] || exit 0 if [ "$GROUP_DIRECTORY" ]; then lliurex-cap sync-with-rconflict "${CAPNAME}" data "${NETGROUP_DIR}/${GROUP_DIRECTORY}/${USER_NAME}" fi ;; batch_processor ) PROPAGATEUSERSFILE="$2" PROPAGATEGROUPSFILE="$3" [ -r "$PROPAGATEUSERSFILE" ] || exit 0 [ -r "$PROPAGATEGROUPSFILE" ] || exit 0 cat $PROPAGATEUSERSFILE | while read line; do if [ "$line" ]; then lliurex-cap sync-with-rconflict "${CAPNAME}" data "$line" fi done sort -u $PROPAGATEGROUPSFILE | while read line; do if [ "$line" ]; then lliurex-cap sync-with-rconflict "${CAPNAME}" data "$line" fi done ;; *) ;; esac exit 0