From b37a62ea1c507074bcc8e03b376096ccc687f890 Mon Sep 17 00:00:00 2001 From: Bohan Yang Date: Sun, 12 May 2019 17:46:10 +0800 Subject: [PATCH] Update --- netboot.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/netboot.sh b/netboot.sh index 7d4e213..85176b5 100644 --- a/netboot.sh +++ b/netboot.sh @@ -21,9 +21,13 @@ set -e command_exists() { _PATH="$PATH" PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin" - command -v "$@" > /dev/null 2>&1 + code=1 + if command -v "$@" >/dev/null 2>&1; then + code=0 + fi PATH="$_PATH" unset _PATH + return $code } user="$(id -un 2>/dev/null || true)"