- 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=
while IFS=, read account_lid account_id ad_user SID RID rest
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" ]
then
[ -z "$account_lid" -o -z "$ad_user" -o "$account_lid" = "$ad_user" ] && {
@ -33,9 +36,14 @@ do
echo "admin/admin-cli.php --edit-group '$ADMIN,$PASSWD,$account_lid=$ad_user'"
RID=-$RID
fi
# if no change necessary, dont
if [ $account_id != $RID ]
then
[ -n "$CHANGE" ] && CHANGE=$CHANGE,
CHANGE=$CHANGE$account_id,$RID
fi
fi
done
echo "admin/admin-cli.php --change-account-id '$ADMIN,$PASSWD,$CHANGE'"