add sfetch

This commit is contained in:
Aaron Bieber 2020-08-21 13:13:08 -06:00
parent d610779329
commit 06bacf0cfb

11
bin/sfetch Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
SERVER=ftp3.usa.openbsd.org
ITEM=$1
MACHINE=$(machine)
[[ ! -z $2 ]] && MACHINE=$2
V=$(uname -r | sed 's/\.//')
ftp -o "${PWD}/${ITEM}" "https://${SERVER}/pub/OpenBSD/snapshots/${MACHINE}/${ITEM}" && \
ftp -VM -o "${PWD}/SHA256.sig" "https://${SERVER}/pub/OpenBSD/snapshots/${MACHINE}/SHA256.sig"
signify -C -p "/etc/signify/openbsd-${V}-base.pub" -x SHA256.sig "${ITEM}"