Skip to content

Instantly share code, notes, and snippets.

@AmauryCarrade
Created October 26, 2020 11:50
Show Gist options
  • Save AmauryCarrade/f5ffd4d89637879c1870c628a9b8e253 to your computer and use it in GitHub Desktop.
Save AmauryCarrade/f5ffd4d89637879c1870c628a9b8e253 to your computer and use it in GitHub Desktop.
Imports users from another permissions plugin to luckperms
#!/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