Commit Diff
Diff:
c5a4674bacd96a390519320eafbd2a8366795aa2
9e4512cd77a176899177e695fbfa4a60ed347d72
Commit:
9e4512cd77a176899177e695fbfa4a60ed347d72
Tree:
7457e9292cd88edbc92da8bc95f040ca3a7ec34d
Author:
Fred. Galusik <f@galusik.fr>
Committer:
Fred. Galusik <f@galusik.fr>
Date:
Sat May 9 08:48:14 2020 UTC
Message:
last fixes
blob - 90c84f22ef3fd00dd8df4df60fd6bbadf1b51ef2
blob + 28d2553ce56b92da0a16b801cc428dfed3fb0ce1
--- snaps
+++ snaps
@@ -46,7 +46,7 @@ set -ue
VERSION=1.3
# choose your MIRROR
-true ${MIRROR:=$(grep -v "^#" /etc/installurl)}
+true "${MIRROR:=$(grep -v "^#" /etc/installurl)}"
# curl is mandatory
if [ ! "$(which curl 2>/dev/null)" ]; then
@@ -99,7 +99,7 @@ s_root() {
}
-toupgrade() {
+s_toupgrade() {
REMOTESNAPS='https://framagit.org/fredg/snaps/raw/master/snaps'
LASTSNAPS=/tmp/snaps
echo "Checking snaps release..."
@@ -122,7 +122,7 @@ toupgrade() {
}
-upgrade() {
+s_upgrade() {
SELFPATH=$(dirname "$(readlink -f -- "$0")")
echo "Downloading last snaps version..."
$GET -o "${SELFPATH}" "${REMOTESNAPS}"
@@ -182,14 +182,14 @@ s_sysup() {
}
-read_cur() {
+read_faq() {
FAQ='https://www.openbsd.org/faq/current.html'
if [ "$(which links 2>/dev/null)" ]; then
READ='links -dump'
elif [ "$(which lynx 2>/dev/null)" ]; then
READ='lynx --dump'
else
- echo "You need 'links' or 'lynx' to read the online FAQ/CURRENT. Aborting..."
+ echo "WARNING: You need 'links' or 'lynx' to read the online FAQ/CURRENT. Aborting..."
exit 1
fi
${READ} ${FAQ} | less
@@ -220,10 +220,15 @@ all_mirrors() {
## Run
##
+if [ $# -eq 0 ]; then
+ usage
+ exit 1
+fi
+
case $1 in
-s)
s_root
- toupgrade
+ s_toupgrade
s_cur
echo ""
s_when
@@ -233,7 +238,7 @@ case $1 in
s_when
;;
-f)
- read_cur
+ read_faq
;;
-a)
all_mirrors
@@ -245,7 +250,7 @@ case $1 in
get_log
;;
-u)
- upgrade
+ s_upgrade
;;
-h|*)
usage
Frédéric Galusik