Created
April 23, 2017 00:54
-
-
Save northox/f4ef509694d1cf440eb27dde48fa9fd0 to your computer and use it in GitHub Desktop.
Download and validate OpenBSD snapshot then install /bsd.rd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
path=snapshots | |
url=ftp://openbsd.cs.toronto.edu/pub/OpenBSD/ | |
rel=`uname -r` | |
major=`echo $rel | sed 's/\..*//'` | |
minor=`echo $rel | sed 's/.*\.//'` | |
mkdir -p $path | |
cd $path | |
ftp -ia ${url}/snapshots/`uname -m`/{man*tgz,comp*tgz,base*tgz,bsd*,INS*,SHA*} || exit 1 | |
signify -q -C -p /etc/signify/openbsd-${major}${minor}-base.pub -x SHA256.sig *tgz bsd* INS* | |
if [ $? -eq 0 ]; then | |
doas cp bsd.rd / | |
echo "Success: bsd.rd installed ($major.$minor)" | |
else | |
let minor=$minor+1 | |
signify -q -C -p /etc/signify/openbsd-${major}${minor}-base.pub -x SHA256.sig *tgz bsd* INS* | |
if [ $? -eq 0 ]; then | |
doas cp bsd.rd / | |
echo "Success: bsd.rd installed ($major.$minor)" | |
else | |
echo signify failed | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment