- if we have no RID but a SID, calculate the RID

- if both numeric ids are identical, dont try to change them
This commit is contained in:
Ralf Becker 2018-03-13 16:04:18 +01:00
parent 7269c8fe77
commit 884224058c

View File

@ -21,6 +21,9 @@ PASSWD=PW
CHANGE= CHANGE=
while IFS=, read account_lid account_id ad_user SID RID rest while IFS=, read account_lid account_id ad_user SID RID rest
do do
# if we have no RID but a SID, calculate the RID
[ -z "$RID" -a -n "$SID" ] && RID=${SID##*-}
if [ -n "$account_id" -a -n "$RID" ] if [ -n "$account_id" -a -n "$RID" ]
then then
[ -z "$account_lid" -o -z "$ad_user" -o "$account_lid" = "$ad_user" ] && { [ -z "$account_lid" -o -z "$ad_user" -o "$account_lid" = "$ad_user" ] && {
@ -33,8 +36,13 @@ do
echo "admin/admin-cli.php --edit-group '$ADMIN,$PASSWD,$account_lid=$ad_user'" echo "admin/admin-cli.php --edit-group '$ADMIN,$PASSWD,$account_lid=$ad_user'"
RID=-$RID RID=-$RID
fi fi
[ -n "$CHANGE" ] && CHANGE=$CHANGE,
CHANGE=$CHANGE$account_id,$RID # if no change necessary, dont
if [ $account_id != $RID ]
then
[ -n "$CHANGE" ] && CHANGE=$CHANGE,
CHANGE=$CHANGE$account_id,$RID
fi
fi fi
done done