From ed5168f59673afe84cbce366f9a66687bf63aaa4 Mon Sep 17 00:00:00 2001 From: TuDatTr Date: Sun, 24 May 2020 03:34:01 +0200 Subject: [PATCH] Fixed cli argument... hopefully --- install.sh | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/install.sh b/install.sh index cb7db9e..03d5c36 100755 --- a/install.sh +++ b/install.sh @@ -16,39 +16,39 @@ if [[ ${PIPESTATUS[0]} -ne 0 ]]; then fi eval set -- "$PARSED" -d="CHANGEME" # Device that shoud be partitioned e.g. "/dev/sda" -t="CHANGEME" # Your timezone according to /usr/share/zoneinfo/ e.g. "/usr/share/zoneinfo/Europ/Berlin" -l="CHANGEME" # Your locale according to /etc/locale.gen e.g. "en_US.UTF-8 UTF-8" -h="CHANGEME" # Name for your machine e.g. "ArchLinux" -u="CHANGEME" # Your username e.g. "foo" -s="CHANGEME" # Name of the sudogrp +device="CHANGEME" # Device that shoud be partitioned e.g. "/dev/sda" +timezone="CHANGEME" # Your timezone according to /usr/share/zoneinfo/ e.g. "/usr/share/zoneinfo/Europ/Berlin" +locale="CHANGEME" # Your locale according to /etc/locale.gen e.g. "en_US.UTF-8 UTF-8" +hostname="CHANGEME" # Name for your machine e.g. "ArchLinux" +username="CHANGEME" # Your username e.g. "foo" +sudogrp="CHANGEME" # Name of the sudogrp CWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" while true; do case "$1" in -d|--device) - d="$2" + device="$2" shift 2 ;; -t|--timezone) - t="$2" + timezone="$2" shift 2 ;; -l|--locale) - l="$2" + locale="$2" shift 2 ;; -h|--hostname) - h="$2" + hostname="$2" shift 2 ;; -u|--username) - u="$2" + username="$2" shift 2 ;; -s|--sudogrp) - s="$2" + sudogrp="$2" shift 2 ;; --help) @@ -67,6 +67,9 @@ Mandatory arguments: " exit 0 ;; + --) + shift + break *) echo "Programming error" exit 3