Created
February 18, 2021 18:01
-
-
Save blizzz/6633bf60bf1e526f32a9a264af20d37b to your computer and use it in GitHub Desktop.
randomly assign users to groups in samba4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for i in {1..3200} | |
do | |
R_UID="Joker ${i}" | |
MEMBERSHIPS="$((($RANDOM % 10) + 10))" | |
for j in {1..${MEMBERSHIPS}}; do | |
R_GROUP="Osmium $((($RANDOM % 200) + 1))" | |
samba-tool group addmembers "${R_GROUP}" "${R_UID}" || true | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment