summaryrefslogtreecommitdiffstats
path: root/usr.sbin/syspatch/syspatch.sh
diff options
context:
space:
mode:
authorajacoutot <ajacoutot@openbsd.org>2017-10-12 15:24:06 +0000
committerajacoutot <ajacoutot@openbsd.org>2017-10-12 15:24:06 +0000
commit2830681c8c9016ddc7e78268f972450b15b7034c (patch)
tree0eacf0e227c812f1b01f6db1ceefbac77f6ebf50 /usr.sbin/syspatch/syspatch.sh
parentAdd STANDARDS: denis@ spotted that it was missing. (diff)
downloadwireguard-openbsd-2830681c8c9016ddc7e78268f972450b15b7034c.tar.xz
wireguard-openbsd-2830681c8c9016ddc7e78268f972450b15b7034c.zip
Better error if installurl points to a local directory.
Diffstat (limited to 'usr.sbin/syspatch/syspatch.sh')
-rw-r--r--usr.sbin/syspatch/syspatch.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/syspatch/syspatch.sh b/usr.sbin/syspatch/syspatch.sh
index 461bce36c02..7df57e25f8a 100644
--- a/usr.sbin/syspatch/syspatch.sh
+++ b/usr.sbin/syspatch/syspatch.sh
@@ -1,6 +1,6 @@
#!/bin/ksh
#
-# $OpenBSD: syspatch.sh,v 1.128 2017/10/12 14:48:30 ajacoutot Exp $
+# $OpenBSD: syspatch.sh,v 1.129 2017/10/12 15:24:06 ajacoutot Exp $
#
# Copyright (c) 2016, 2017 Antoine Jacoutot <ajacoutot@openbsd.org>
#
@@ -155,10 +155,11 @@ ls_installed()
ls_missing()
{
- local _c _f _cmd _l="$(ls_installed)" _p _r _sha=${_TMP}/SHA256
+ local _c _d _f _cmd _l="$(ls_installed)" _p _r _sha=${_TMP}/SHA256
# return inmediately if we cannot reach the mirror server
- [[ -d ${_MIRROR#file://*} ]] ||
+ [[ ${_MIRROR} == @(file://*) ]] && _d="${_MIRROR#file://*}" &&
+ [[ -d ${_d%syspatch/*} ]] ||
unpriv ftp -MVo /dev/null ${_MIRROR%syspatch/*} >/dev/null
set +e # manually handle unpriv() errors