I don't remember if I ever posted it, but I've been using an "upgrade"
script to download bsd.rd, verify it, move it to /bsd, and reboot.
With florian@'s additions in -current, I have now extended the
script to download the sets and kick off an unattended upgrade.

In the best case, you simply run
# ./upgrade
and the machine will upgrade itself without any further intervention.

#!/bin/sh -e

case $# in
0)      installurl=$(sed 's/#.*//;/^$/d' /etc/installurl) 2>/dev/null ||
1)      installurl=$1
*)      echo "usage: ${0##*/} [server_URL]" >&2 ; exit 1 ;;

arch=$(sysctl -n hw.machine)

mkdir -p /home/upgrade
cd /home/upgrade
ftp "$urlbase/SHA256.sig"

version=$(sed -n 's/^SHA256 (base\([0-9]\{2,3\}\)\.tgz) .*/\1/p' SHA256.sig)
test -n "$version"
signify -V -p "$pubkey" -x SHA256.sig -e -m /dev/null

sets=$(sed -e 's/^SHA256 (\(.*\)) .*/\1/' \
    -e "/^INSTALL.$arch\$/p;/^bsd/p;/$version\.tgz\$/p;d" SHA256.sig)
ftp $(for i in $sets; do echo "$urlbase/$i"; done)
signify -C -p "$pubkey" -x SHA256.sig $sets
cp bsd.rd /bsd.upgrade

Christian "naddy" Weisgerber                          na...@mips.inka.de

Reply via email to