xin/bins/sfetch.nix

19 lines
452 B
Nix
Raw Normal View History

2022-10-17 09:59:32 -06:00
{ curl, gosignify }:
2022-08-25 12:21:35 -06:00
''
2022-10-17 11:12:01 -06:00
#!/usr/bin/env sh
2022-08-25 12:21:35 -06:00
2022-10-17 11:12:01 -06:00
set -e
2022-08-25 12:21:35 -06:00
2022-10-17 11:12:01 -06:00
SERVER=cdn.openbsd.org
ITEM=$1
2022-11-03 12:22:47 -06:00
MACHINE=''${2:-amd64}
V="72"
2022-10-17 11:12:01 -06:00
[[ ! -z $2 ]] && MACHINE=$2
${curl}/bin/curl -s -o "$PWD/$ITEM" "https://$SERVER/pub/OpenBSD/snapshots/$MACHINE/$ITEM" && \
${curl}/bin/curl -s -o "$PWD/SHA256.sig" "https://$SERVER/pub/OpenBSD/snapshots/$MACHINE/SHA256.sig"
2022-08-25 12:21:35 -06:00
2022-10-17 11:12:01 -06:00
${gosignify}/bin/gosignify -C -p "/etc/signify/openbsd-$V-base.pub" -x SHA256.sig "$ITEM"
2022-08-25 12:21:35 -06:00
''