summaryrefslogtreecommitdiffstats
path: root/usr.sbin/syspatch
diff options
context:
space:
mode:
authorajacoutot <ajacoutot@openbsd.org>2017-10-12 15:52:44 +0000
committerajacoutot <ajacoutot@openbsd.org>2017-10-12 15:52:44 +0000
commitb1888294780b9a413d8326b3a31566582a17b45c (patch)
tree3ab2f711d21ac7a3f5a5d2980898119864a5a596 /usr.sbin/syspatch
parentDrop prototypes for ssl23_*() functions, which no longer exist. (diff)
downloadwireguard-openbsd-b1888294780b9a413d8326b3a31566582a17b45c.tar.xz
wireguard-openbsd-b1888294780b9a413d8326b3a31566582a17b45c.zip
Simplify and explicitely state when we cannot access our mirror.
Diffstat (limited to 'usr.sbin/syspatch')
-rw-r--r--usr.sbin/syspatch/syspatch.sh11
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.sbin/syspatch/syspatch.sh b/usr.sbin/syspatch/syspatch.sh
index 5134ed6e178..7efb47de5c7 100644
--- a/usr.sbin/syspatch/syspatch.sh
+++ b/usr.sbin/syspatch/syspatch.sh
@@ -1,6 +1,6 @@
#!/bin/ksh
#
-# $OpenBSD: syspatch.sh,v 1.130 2017/10/12 15:26:08 ajacoutot Exp $
+# $OpenBSD: syspatch.sh,v 1.131 2017/10/12 15:52:44 ajacoutot Exp $
#
# Copyright (c) 2016, 2017 Antoine Jacoutot <ajacoutot@openbsd.org>
#
@@ -157,12 +157,11 @@ ls_missing()
{
local _c _d _f _cmd _l="$(ls_installed)" _p _r _sha=${_TMP}/SHA256
- # return inmediately if we cannot reach the mirror server
- [[ ${_MIRROR} == @(file://*) ]] && _d="${_MIRROR#file://*}" &&
- [[ -d ${_d%syspatch/*} ]] ||
- unpriv ftp -MVo /dev/null ${_MIRROR%syspatch/*} >/dev/null
-
set +e # manually handle unpriv() errors
+ # return inmediately if we cannot reach the mirror server
+ _d="${_MIRROR#file://*}" && [[ -d ${_d%syspatch/*} ]] ||
+ unpriv ftp -MVo /dev/null ${_MIRROR%syspatch/*} >/dev/null ||
+ sp_err "Cannot access ${_MIRROR%syspatch/*}" || return
unpriv -f "${_sha}.sig" ftp -MVo "${_sha}.sig" "${_MIRROR}/SHA256.sig" \
>/dev/null 2>&1 || return 0 # nonexistent: no patch available
set -e