diff options
author | lassulus <lassulus@lassul.us> | 2023-01-19 14:11:01 +0100 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2023-01-19 14:11:01 +0100 |
commit | b51998cfae7b6fe892f9f0f9a2c0ffcfeeded0ba (patch) | |
tree | ca76ec46d32a99edacfd2d0be19a7f1ef410fe76 /krebs/3modules/github/update | |
parent | 347bb9ae00f8f1b6942f94d4c983593052a5c227 (diff) | |
parent | 57abca263fe86259807e5597d1c8f11c3c3acd44 (diff) |
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'krebs/3modules/github/update')
-rwxr-xr-x | krebs/3modules/github/update | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/krebs/3modules/github/update b/krebs/3modules/github/update new file mode 100755 index 000000000..3952dabae --- /dev/null +++ b/krebs/3modules/github/update @@ -0,0 +1,15 @@ +#! /usr/bin/env nix-shell +#! nix-shell -i bash -p cidr2glob curl git jq + +# update known-hosts.json +# +# usage: ./update + +set -efu + +# XXX IPv6 addresses are currently ignored +curl -sS https://api.github.com/meta | jq -r .git[] | grep -v : | cidr2glob | jq -Rs 'split("\n")|map(select(.!=""))' > known-hosts.json + +if git diff --exit-code known-hosts.json; then + echo known-hosts.json is up to date: nothing to do >&2 +fi |