From efcd264ca0a4407de438e861311c62357785dc5c Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 23 Oct 2023 12:15:49 +0200 Subject: [SSPS] install packages: Validate argument --- satellit_installer/includes/10-install_packages.inc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/satellit_installer/includes/10-install_packages.inc b/satellit_installer/includes/10-install_packages.inc index 0d96cfa..50e9572 100644 --- a/satellit_installer/includes/10-install_packages.inc +++ b/satellit_installer/includes/10-install_packages.inc @@ -23,9 +23,11 @@ install_packages() { echo "#" case "$1" in - NOREC) INSTALLOPTIONS="-qq -y --no-install-recommends" + NOREC) INSTALLOPTIONS="-qq -y --no-install-recommends" ;; - RECOM) INSTALLOPTIONS="-qq -y" + RECOM) INSTALLOPTIONS="-qq -y" + ;; + *) perror "Invalid install_packages mode: $1" ;; esac install_package $NEEDED_PACKAGES # No quotes @@ -36,7 +38,7 @@ install_files() { local dir="${BASEDIR}/static_files/${1}" [ -d "$dir" ] || perror "static files for module $1 not found" tar -cpP --owner=root --group=root --transform "s,^\(./\)*${dir}/*,," "$dir" | tar -xp -C / - local ps=( ${PIPESTATUS[*]} ) + local ps=( "${PIPESTATUS[@]}" ) [ "${ps[0]}" != 0 ] && perror "tarcopy: Read failed" [ "${ps[1]}" != 0 ] && perror "tarcopy: Write failed" return 0 -- cgit v1.2.3-55-g7522