mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-19 04:05:36 +00:00
Not the diff result + use chmod so all users can read the mailing list.
This commit is contained in:
+2
-1
@@ -8,11 +8,12 @@ NAME_TO_STORE_IN="landscapeManagersMailingList"
|
||||
BASE_URL="https://security-service.sapsailing.com"
|
||||
curl_output=$( curl -H 'X-SAPSSE-Forward-Request-To: master' -H 'Authorization: Bearer '${BEARER_TOKEN} "${BASE_URL}/security/api/restsecurity/users_with_permission?permission=LANDSCAPE:MANAGE:AWS" 2>/dev/null )
|
||||
temp_file_path=$(mktemp /var/cache/emails_XXX)
|
||||
chmod 644 $temp_file_path
|
||||
echo $curl_output | jq -r .[] | while read user; do
|
||||
email=$(curl -H 'X-SAPSSE-Forward-Request-To: master' -H 'Authorization: Bearer '${BEARER_TOKEN} "${BASE_URL}/security/api/restsecurity/user?username=$user" 2>/dev/null| jq -r '.email' )
|
||||
echo $email >> $temp_file_path
|
||||
done
|
||||
if diff ${PATH_TO_STORE}/${NAME_TO_STORE_IN} ${temp_file_path}; then
|
||||
if ! diff ${PATH_TO_STORE}/${NAME_TO_STORE_IN} ${temp_file_path}; then
|
||||
mv "$temp_file_path" ${PATH_TO_STORE}/${NAME_TO_STORE_IN}
|
||||
else
|
||||
rm ${temp_file_path}
|
||||
|
||||
Reference in New Issue
Block a user