Created
February 18, 2021 18:01
-
-
Save blizzz/47dad2e002cb8128e7c79d22c5183cf9 to your computer and use it in GitHub Desktop.
randomly assign groups 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..200} | |
do | |
R_GID="Osmium ${i}" | |
MEMBERSHIPS="$((($RANDOM % 3)))" | |
for j in {1..${MEMBERSHIPS}}; do | |
R_GROUP="Osmium $((($RANDOM % 200) + 1))" | |
samba-tool group addmembers "${R_GROUP}" "${R_GID}" || true | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment