From 540afb8bc12f0b486e603db23ca2fdad5c7c1f4a Mon Sep 17 00:00:00 2001 From: pharook <ph@rook.cz> Date: Tue, 18 Oct 2016 18:03:38 +0200 Subject: [PATCH] Script now detects binaries existence by calling shell builtin, not binaries themselves --- warden3/contrib/warden_ra/warden_apply.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/warden3/contrib/warden_ra/warden_apply.sh b/warden3/contrib/warden_ra/warden_apply.sh index 68ec606..3d53cfa 100755 --- a/warden3/contrib/warden_ra/warden_apply.sh +++ b/warden3/contrib/warden_ra/warden_apply.sh @@ -15,8 +15,9 @@ function flee { echo -e "$1"; exit $2; } [ -z "$client" -o -z "$password" ] && flee "Usage: ${0%.*} client.name password" 255 -openssl version >/dev/null 2>&1 || flee "Haven't found 'openssl' binary." -curl --version >/dev/null 2>&1 || flee "Haven't found 'curl' binary." +for n in openssl curl; do + command -v "$n" 2>/dev/null || flee "Haven't found $n binary." +done for n in "$csr" "$key" "$cert"; do [ -e "$n" ] && flee "$n already exists, I won't overwrite, move them away first, please." 254 done -- GitLab