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