From c92b3e514879562147474bbe33872a710747afc9 Mon Sep 17 00:00:00 2001 From: z4yx Date: Mon, 27 Apr 2020 16:37:15 +0800 Subject: [PATCH] test size calc on ELF --- ELK.sh | 5 +++++ helpers/size-sum.sh | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ELK.sh b/ELK.sh index 021c2de..35eea6a 100755 --- a/ELK.sh +++ b/ELK.sh @@ -12,6 +12,9 @@ BASE_URL=${TUNASYNC_UPSTREAM_URL:-"https://packages.elastic.co"} YUM_PATH="${BASE_PATH}/yum" APT_PATH="${BASE_PATH}/apt" +export REPO_SIZE_FILE=/tmp/reposize.$RANDOM +echo -n 0 >$REPO_SIZE_FILE + declare -A REPO_VERSIONS=( ["elasticsearch"]="2.x" ["logstash"]="2.3 2.4 5.0" @@ -38,3 +41,5 @@ for repo in "${!REPO_VERSIONS[@]}"; do components=${versions// /,} "$yum_sync" "${BASE_URL}/${repo}/@{comp}/centos/" 7 "$components" x86_64 "${repo}-@{comp}" "$YUM_PATH" done + +"${_here}/helpers/size-sum.sh" $REPO_SIZE_FILE; rm $REPO_SIZE_FILE \ No newline at end of file diff --git a/helpers/size-sum.sh b/helpers/size-sum.sh index dfb8d14..f743a57 100755 --- a/helpers/size-sum.sh +++ b/helpers/size-sum.sh @@ -1,3 +1,4 @@ #!/bin/bash -sz=`bc <$1` +sz=$(cat $1) +sz=$(echo $sz | bc) echo "size-sum:" $(numfmt --to=iec $sz)