From e362dd20578199c4ad2a47756bb45a115ac0854e Mon Sep 17 00:00:00 2001 From: Antoine Jacoutot Date: Thu, 12 Oct 2017 15:24:07 +0000 Subject: Better error if installurl points to a local directory. --- usr.sbin/syspatch/syspatch.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'usr.sbin') 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 # @@ -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 -- cgit v1.2.3