From 08c72e9cb4089200932a892e9a184e04ec5b0781 Mon Sep 17 00:00:00 2001 From: Miles Goodhew Date: Wed, 25 Jan 2023 21:45:40 +1100 Subject: [PATCH] Converted to non-Bash editor searching --- edit-options.sh | 11 +++-------- install-driver.sh | 11 +++-------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/edit-options.sh b/edit-options.sh index 7316127..030b06a 100755 --- a/edit-options.sh +++ b/edit-options.sh @@ -26,8 +26,7 @@ SCRIPT_NAME="edit-options.sh" SCRIPT_VERSION="20230120" OPTIONS_FILE="8821cu.conf" -DEFAULT_EDITOR="$(/dev/null 2>&1 - then - TEXT_EDITOR="${editor}" - break - fi + command -v "${TEXT_EDITOR}" >/dev/null 2>&1 && break done # Fail if no editor was found diff --git a/install-driver.sh b/install-driver.sh index dca23a6..a2c551b 100755 --- a/install-driver.sh +++ b/install-driver.sh @@ -38,8 +38,7 @@ OPTIONS_FILE="${MODULE_NAME}.conf" SMEM=$(LANG=C free | awk '/Mem:/ { print $2 }') sproc=$(nproc) -DEFAULT_EDITOR="$(/dev/null 2>&1 - then - TEXT_EDITOR="${editor}" - break - fi + command -v "${TEXT_EDITOR}" >/dev/null 2>&1 && break done # Fail if no editor was found