From 1040fbddc68aaec0d8f051fd44c045f543d5a7e3 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Wed, 28 Dec 2016 09:46:04 -0800 Subject: [PATCH] Improve data-file handling --- scripts/installer.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/scripts/installer.sh b/scripts/installer.sh index aebe0b88b..db029724f 100755 --- a/scripts/installer.sh +++ b/scripts/installer.sh @@ -23,26 +23,19 @@ readonly is_update=$([[ -f "${CLOUDRON_CONF}" ]] && echo "yes" || echo "no") chmod +x /root/provision.sh arg_data="" -arg_data_file="" args=$(getopt -o "" -l "data:,data-file:" -n "$0" -- "$@") eval set -- "${args}" while true; do case "$1" in - --data) arg_data="$2";; - --data-file) arg_data_file="$2";; + --data) arg_data="$2"; shift 2;; + --data-file) arg_data=$(cat $2); shift 2;; --) break;; *) echo "Unknown option $1"; exit 1;; esac - - shift 2 done -if [[ ! -z ${arg_data_file} ]]; then - arg_data=$(cat "${arg_data_file}") -fi - # ensure ownership baked into the tarball is overwritten chown -R root.root "${box_src_tmp_dir}"