From 8126bbf87f43e55098d09cd7592a60418ea19d2a Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 11 Mar 2022 18:25:31 +0100 Subject: [PATCH] grml2iso: execute under pipefail Quoting from bash(1): | The return status of a pipeline is the exit status of the last | command, unless the pipefail option is enabled. If pipefail is enabled, | the pipeline's return status is the value of the last (rightmost) | command to exit with a non-zero status, or zero if all commands exit | successfully. Furthermore, move the "set -e" to the beginning of the file, to ensure it's active as soon as possible. While at it, drop trailing whitespace and update ISO name to a more recent one. This work was funded by Grml-Forensic. --- grml2iso | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grml2iso b/grml2iso index b29c4df..3e48688 100755 --- a/grml2iso +++ b/grml2iso @@ -6,6 +6,8 @@ # License: This file is licensed under the GPL v2 or any later version. ################################################################################ +set -e -o pipefail + # make sure we have the sbin directories in our PATH to find grml2usb ootb PATH="${PATH}:/sbin:/usr/local/sbin:/usr/sbin" @@ -32,8 +34,6 @@ fi # }}} # helper stuff {{{ - set -e - usage() { echo >&2 "Usage: $0 [OPTIONS] -o target.iso source1.iso [source2.iso ...]" echo >&2 " @@ -56,7 +56,7 @@ Options: created by mktemp(1). Examples: - $0 -s http://192.168.23.42:8000/grml/ -o small.iso grml64-small_2018.12.iso + $0 -s http://192.168.23.42:8000/grml/ -o small.iso grml64-small_2021.07.iso Will generate a file small.iso which tries to download the squashfs file from http://192.168.23.42:8000/grml/ - the squashfs file is placed in the same -- 2.1.4