From aefc99efcecdf0b757248bc63a5f5e16d9690bf2 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Tue, 7 May 2024 11:59:24 +0100 Subject: [PATCH] fix(quickemu): resolve shellcheck SC2155 warnings https://www.shellcheck.net/wiki/SC2155 --- quickemu | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/quickemu b/quickemu index 7b26e37..4ba4b75 100755 --- a/quickemu +++ b/quickemu @@ -237,6 +237,7 @@ function vm_boot() { local OSK="" local SOUND="" local SMM="${SMM:-off}" + local TEMP_PORT="" local USB_HOST_PASSTHROUGH_CONTROLLER="qemu-xhci" local VGA="" local VIDEO="" @@ -1252,11 +1253,11 @@ function vm_boot() { echo " - Monitor: (off)" elif [ "${MONITOR}" == "telnet" ]; then # Find a free port to expose monitor-telnet to the guest - local temp_port="$(get_port ${MONITOR_TELNET_PORT} 9)" - if [ -z "${temp_port}" ]; then + TEMP_PORT="$(get_port ${MONITOR_TELNET_PORT} 9)" + if [ -z "${TEMP_PORT}" ]; then echo " - Monitor: All Monitor-Telnet ports have been exhausted." else - MONITOR_TELNET_PORT="${temp_port}" + MONITOR_TELNET_PORT="${TEMP_PORT}" # shellcheck disable=SC2054 args+=(-monitor telnet:${MONITOR_TELNET_HOST}:${MONITOR_TELNET_PORT},server,nowait) echo " - Monitor: On host: telnet ${MONITOR_TELNET_HOST} ${MONITOR_TELNET_PORT}" @@ -1291,11 +1292,11 @@ function vm_boot() { args+=(-serial none) elif [ "${SERIAL}" == "telnet" ]; then # Find a free port to expose serial-telnet to the guest - local temp_port="$(get_port ${SERIAL_TELNET_PORT} 9)" - if [ -z "${temp_port}" ]; then + TEMP_PORT="$(get_port ${SERIAL_TELNET_PORT} 9)" + if [ -z "${TEMP_PORT}" ]; then echo " - Serial: All Serial-Telnet ports have been exhausted." else - SERIAL_TELNET_PORT="${temp_port}" + SERIAL_TELNET_PORT="${TEMP_PORT}" # shellcheck disable=SC2054,SC2206 args+=(-serial telnet:${SERIAL_TELNET_HOST}:${SERIAL_TELNET_PORT},server,nowait) echo " - Serial: On host: telnet ${SERIAL_TELNET_HOST} ${SERIAL_TELNET_PORT}"