From 033ceaa64ad89cdedb45f3fc3b6269063402b1bd Mon Sep 17 00:00:00 2001 From: Corentin LABBE Date: Tue, 16 Oct 2018 16:08:31 +0200 Subject: Permit to create groups This patch adds support for creating groups --- lava-master/scripts/setup.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'lava-master/scripts') diff --git a/lava-master/scripts/setup.sh b/lava-master/scripts/setup.sh index 426876f..b362d16 100755 --- a/lava-master/scripts/setup.sh +++ b/lava-master/scripts/setup.sh @@ -66,6 +66,30 @@ if [ -e /root/lava-users ];then done fi +if [ -e /root/lava-groups ];then + for group in $(ls /root/lava-groups/*group) + do + GROUPNAME="" + SUBMIT=0 + OPTION_SUBMIT="" + . $group + if [ $SUBMIT -eq 1 ];then + echo "DEBUG: $GROUPNAME can submit jobs" + OPTION_SUBMIT="--submitting" + fi + echo "DEBUG: Add group $GROUPNAME" + lava-server manage groups add $OPTION_SUBMIT $GROUPNAME || exit 1 + if [ -e ${group}.list ];then + echo "DEBUG: Found ${group}.list" + while read username + do + echo "DEBUG: Add user $username to group $GROUPNAME" + lava-server manage groups update --username $username $GROUPNAME || exit 1 + done < ${group}.list + fi + done +fi + if [ -e /root/lava-callback-tokens ];then for ct in $(ls /root/lava-callback-tokens) do -- cgit 1.2.3-korg