From 2ede6aa1af8ea432bc62de37de43d616e38c09dc Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Mon, 11 Jan 2021 10:16:23 -0700 Subject: [PATCH] sfetch: allow getting by arch --- bin/sfetch | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/sfetch b/bin/sfetch index 5cf65f5..08707e1 100755 --- a/bin/sfetch +++ b/bin/sfetch @@ -3,9 +3,14 @@ SERVER=ftp3.usa.openbsd.org ITEM=$1 MACHINE=$(machine) -[[ ! -z $2 ]] && MACHINE=$2 +VER=snapshots 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" +[[ ! -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}"