Created
October 26, 2020 11:50
-
-
Save AmauryCarrade/f5ffd4d89637879c1870c628a9b8e253 to your computer and use it in GitHub Desktop.
Imports users from another permissions plugin to luckperms
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
#!/usr/local/bin/bash | |
users_yaml='./users.yml' | |
uuid='' | |
while read -r line | |
do | |
if [[ "$line" == "users:" ]] || [[ "$line" == "groups:" ]] || [[ "$line" == permissions* ]]; then | |
continue | |
fi | |
if [[ "$line" = *: ]]; then | |
uuid=${line%:} | |
else | |
if [ -n $uuid ]; then | |
if [ "$line" == "- membre" ]; then | |
./broadcast_command.sh "lp user ${uuid} parent set membre" | |
fi | |
if [ "$line" == "- veteran" ]; then | |
./broadcast_command.sh "lp user ${uuid} parent set membre" | |
./broadcast_command.sh "lp user ${uuid} parent add veteran" | |
fi | |
fi | |
fi | |
done < "$users_yaml" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment