dotconf/bin/sfetch
2021-01-16 09:38:30 -07:00

17 lines
452 B
Bash
Executable File

#!/bin/sh
SERVER=cdn.openbsd.org
ITEM=$1
MACHINE=$(machine)
VER=snapshots
V=$(uname -r | sed 's/\.//')
[[ ! -z $2 ]] && MACHINE=$2
if [[ ! -z $3 ]]; then
VER=$3
V=$(echo $VER | sed 's/\.//')
fi
ftp -o "${PWD}/${ITEM}" "https://${SERVER}/pub/OpenBSD/${VER}/${MACHINE}/${ITEM}" && \
ftp -VM -o "${PWD}/SHA256.sig" "https://${SERVER}/pub/OpenBSD/${VER}/${MACHINE}/SHA256.sig"
signify -C -p "/etc/signify/openbsd-${V}-base.pub" -x SHA256.sig "${ITEM}"