Commit Diff
Diff:
65fa7c7251b1b12032df55c70951538414ce9293
32bc417ca6e6227966b421f63ce2b7a9bb49ac45
Commit:
32bc417ca6e6227966b421f63ce2b7a9bb49ac45
Tree:
f83146565795aa53e849d8460d30b8b486567954
Author:
Fred. Galusik <dev1@galusik.xyz>
Committer:
Fred. Galusik <dev1@galusik.xyz>
Date:
Mon Mar 6 21:47:44 2017 UTC
Message:
Take care of removed /etc/pkg.conf (thuban patch)
blob - a623bea5c44acb236b47b7896737a3b53cd838e7
blob + 4749872541ec5b74fc7b60b5456bf14058e8f14b
--- snaps
+++ snaps
@@ -4,7 +4,7 @@
#
# snaps.sh - Upgrade your OpenBSD OS base to last -current snapshot
#
-# Copyright (c) 2016, Fred Galusik <f AT galusik.xyz>
+# Copyright (c) 2017, Fred Galusik <f AT galusik.xyz>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -40,26 +40,21 @@
### VARS
###
-VERSION=1.0.1
-RL=60 # signify var
+VERSION=1.0.2
-MIRRORSOURCE=$(awk -F '=' '/^installpath/ { gsub(/ /,"",$2); print $2 }' /etc/pkg.conf)
-ARCH=$(uname -m)
-
if [ ! $MIRROR ]; then
- MIRROR="$(echo $MIRRORSOURCE | cut -d'/' -f-3)"
+ MIRROR=$(cat /etc/installurl)
fi
+ARCH=$(uname -m)
-BPATH=/pub/OpenBSD/snapshots/${ARCH}/
-PKGPATH=/pub/OpenBSD/snapshots/packages/${ARCH}/
-MIRRORB=${MIRROR}${BPATH}
-MIRRORPKG=${MIRROR}${PKGPATH}
+MIRRORB=${MIRROR}/snapshots/${ARCH}/
+MIRRORPKG=${MIRROR}/snapshots/packages/${ARCH}/
BSDRD=bsd.rd
SHAF=SHA256
SIGF=SHA256.sig
-SIGNPUB=/etc/signify/openbsd-$RL-base.pub
+SIGNPUB=$(ls /etc/signify/openbsd-*-base.pub |tail -n1)
GET='ftp -n -m -C'
REBOOT='/sbin/reboot'
@@ -116,10 +111,10 @@ usage() {
echo " -u upgrade snaps to last version"
echo " -h print this help and exit"
echo ""
- echo "MIRROR is based upon /etc/pkg.conf and set to: $MIRROR"
+ echo "MIRROR is based upon /etc/installurl and set to: $MIRROR"
echo ""
echo "You can set it manually:"
- echo "\$ MIRROR=http://mirrors.ircam.fr doas snaps -G"
+ echo "\$ MIRROR=http://mirrors.ircam.fr/pub/OpenBSD doas snaps -G"
echo ""
}
@@ -288,4 +283,3 @@ case $1 in
exit 1
;;
esac
-
Frédéric Galusik