From 1e0ffd02973a154e1475e5262ba3415190335609 Mon Sep 17 00:00:00 2001 From: nl6720 Date: Mon, 17 Aug 2020 20:26:26 +0300 Subject: scripts/run_archiso.sh: don't duplicate qemu commands for each boot mode Various bash script improvements. --- scripts/run_archiso.sh | 103 ++++++++++++++++++++++--------------------------- 1 file changed, 46 insertions(+), 57 deletions(-) (limited to 'scripts') diff --git a/scripts/run_archiso.sh b/scripts/run_archiso.sh index 210246c..4a062ee 100755 --- a/scripts/run_archiso.sh +++ b/scripts/run_archiso.sh @@ -15,117 +15,106 @@ set -eu print_help() { - cat << EOF + local usagetext + IFS='' read -r -d '' usagetext < 0 )); then while getopts 'bhi:su' flag; do - case "${flag}" in + case "$flag" in b) - boot_type=bios + boot_type='bios' ;; h) print_help @@ -135,13 +124,13 @@ if [ ${#@} -gt 0 ]; then image="$OPTARG" ;; u) - boot_type=uefi + boot_type='uefi' ;; s) - secure_boot=yes + secure_boot='on' ;; *) - echo "Error: Wrong option. Try 'run_archiso -h'." + printf '%s\n' "Error: Wrong option. Try 'run_archiso -h'." exit 1 ;; esac -- cgit v1.2.3-54-g00ecf