feat: create ports_param_check()

This commit is contained in:
Martin Wimpress 2024-05-13 17:40:01 +01:00 committed by Martin Wimpress
parent f723ce6196
commit 6d44ca8c2d
1 changed files with 12 additions and 0 deletions

View File

@ -1442,6 +1442,18 @@ function display_param_check() {
fi 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() { 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 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." echo "ERROR! Requested sound card '${sound_card}' is not recognised."