Skip to content

Commit

Permalink
terraform/advertise-routes: append routes to file (#9)
Browse files Browse the repository at this point in the history
otherwise routes from other sources were being overwritten
  • Loading branch information
clstokes authored Feb 12, 2024
1 parent 3f77e5b commit 85dd216
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ jq -r '.prefixes[] | select(.service == "${s}").ip_prefix' $JSON_FILE >> $OUTPUT
jq -r '.ipv6_prefixes[] | select(.service == "${s}").ipv6_prefix' $JSON_FILE >> $OUTPUT_FILE_TMP
%{ endfor ~}

cat $OUTPUT_FILE_TMP | sort | uniq > $OUTPUT_FILE
cat $OUTPUT_FILE_TMP | sort | uniq >> $OUTPUT_FILE # append to file to not overwrite routes from other sources

echo -e '\n#\n# Complete.\n#\n'
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ curl -s 'https://api.github.com/meta' > $JSON_FILE
jq -r '.${s}[]' $JSON_FILE >> $OUTPUT_FILE_TMP
%{ endfor ~}

cat $OUTPUT_FILE_TMP | sort | uniq > $OUTPUT_FILE
cat $OUTPUT_FILE_TMP | sort | uniq >> $OUTPUT_FILE # append to file to not overwrite routes from other sources

echo -e '\n#\n# Complete.\n#\n'
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ curl -s 'https://s3.amazonaws.com/okta-ip-ranges/ip_ranges.json' > $JSON_FILE
jq -r '.${s}.ip_ranges[]' $JSON_FILE >> $OUTPUT_FILE_TMP
%{ endfor ~}

cat $OUTPUT_FILE_TMP | sort | uniq > $OUTPUT_FILE
cat $OUTPUT_FILE_TMP | sort | uniq >> $OUTPUT_FILE # append to file to not overwrite routes from other sources

echo -e '\n#\n# Complete.\n#\n'

0 comments on commit 85dd216

Please sign in to comment.