diff --git a/pica-wekan/policy.sh b/pica-wekan/policy.sh index 98e38850aa7b935d19239a0d5b5f2592a3232aaa..e7b853806bd388bf80b79c25fab189aa18ad9b53 100755 --- a/pica-wekan/policy.sh +++ b/pica-wekan/policy.sh @@ -7,6 +7,24 @@ queryPica=$(curl -s https://wekan.test.picasoft.net/users/login -d 'username='"$ token=$(echo $queryPica | jq -r .token) expirationDate=$(echo $queryPica | jq -r .tokenExpires) -curl -X GET https://wekan.test.picasoft.net/api/boards \ +# récupération des ids de tous les boards publics +idBoards=$(curl -s -X GET https://wekan.test.picasoft.net/api/boards \ -H 'Accept: application/json' \ - -H 'Authorization: Bearer '"$token"'' + -H 'Authorization: Bearer '"$token"'' | jq -r '.[]._id') + +# affiche la dernière date de modification de tous les boards publics +for idBoard in $idBoards +do + board=$(curl -s -X GET https://wekan.test.picasoft.net/api/boards/$idBoard \ + -H 'Accept: application/json' \ + -H 'Authorization: Bearer '"$token"'') + + lastModificationDate=$(echo $board | jq -r '.modifiedAt') + creationDate=$(echo $board | jq -r '.createdAt') + if [ $lastModificationDate = null ] + then + echo "Board" $idBoard ":" $creationDate + else + echo "Board" $idBoard ":" $lastModificationDate + fi +done