From e260deb32ea88b090f96fd28b0866e161c877e48 Mon Sep 17 00:00:00 2001 From: "Christos.K" Date: Mon, 14 Aug 2017 13:16:27 +0300 Subject: Update gse with conditions for _ct_conf --- bin/gse | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/gse b/bin/gse index 2cfa724..dcf2ef0 100755 --- a/bin/gse +++ b/bin/gse @@ -142,7 +142,29 @@ while true; do done } -if echo "$@" | grep -q '\--build-controller'; then +if echo "$@" | grep -q '\--conf'; then + if [[ "$#" != 1 ]]; then + die "--conf argument has been detected" + fi + + if [[ "$1" != *'='* || "${1#*=}" == '' ]]; then + die "No target file was given" + fi + + if [[ ! -e "${1#*=}" ]]; then + die "No such file or directory" + fi + + if [[ -d "${1#*=}" ]]; then + die "Target is a directory, aborting" + fi + + if _ct_conf; then + _make_cimage + else + die "Exporting arguments from the configuration file has failed" + fi +elif echo "$@" | grep -q '\--build-controller'; then if _controller_args "${@:2}"; then _make_cimage "${@:2}" else -- cgit v1.2.3-65-gdbad