Skip to content

Commit f396f38

Browse files
committed
Fixes issue in applying permissions
1 parent 05830f8 commit f396f38

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

set-esxi-vm-permission-all-users.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ BASEDIR=$(dirname $0)
2323

2424
for USER_NAME in `$BASEDIR/get-esxi-users.sh`
2525
do
26-
isinlist $USER_NAME "root,dcui,vpxuser,$EXCLUDED_USER_NAMES"
27-
if [ "$?" -ne "1" ]; then
26+
EXIT=0
27+
isinlist $USER_NAME "root,dcui,vpxuser,$EXCLUDED_USER_NAMES" || EXIT=$?
28+
if [ "$EXIT" -ne "1" ]; then
2829
echo "Applying permissions for $USER_NAME"
2930
$BASEDIR/add-esxi-vm-permission.sh $VM_NAME $USER_NAME $ROLE_NAME
31+
else
32+
echo "Skipping user $USER_NAME"
3033
fi
3134
done
3235

0 commit comments

Comments
 (0)