From 6d44ca8c2dc76d2a148a531498a730d134857910 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Mon, 13 May 2024 17:40:01 +0100 Subject: [PATCH] feat: create ports_param_check() --- quickemu | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/quickemu b/quickemu index a4b03a0..0e644e6 100755 --- a/quickemu +++ b/quickemu @@ -1442,6 +1442,18 @@ function display_param_check() { fi } +function ports_param_check() { + if [ -n "${ssh_port}" ] && ! is_numeric "${ssh_port}"; then + echo "ERROR: ssh_port must be a number!" + exit 1 + fi + + if [ -n "${spice_port}" ] && ! is_numeric "${spice_port}"; then + echo "ERROR: spice_port must be a number!" + exit 1 + fi +} + function sound_card_param_check() { if [ "${sound_card}" != "ac97" ] && [ "${sound_card}" != "es1370" ] && [ "${sound_card}" != "ich9-intel-hda" ] && [ "${sound_card}" != "intel-hda" ] && [ "${sound_card}" != "sb16" ] && [ "${sound_card}" != "usb-audio" ] && [ "${sound_card}" != "none" ]; then echo "ERROR! Requested sound card '${sound_card}' is not recognised."