test size calc on ELF

This commit is contained in:
z4yx 2020-04-27 16:37:15 +08:00
parent 1008f9fe9e
commit c92b3e5148
2 changed files with 7 additions and 1 deletions

5
ELK.sh
View File

@ -12,6 +12,9 @@ BASE_URL=${TUNASYNC_UPSTREAM_URL:-"https://packages.elastic.co"}
YUM_PATH="${BASE_PATH}/yum" YUM_PATH="${BASE_PATH}/yum"
APT_PATH="${BASE_PATH}/apt" APT_PATH="${BASE_PATH}/apt"
export REPO_SIZE_FILE=/tmp/reposize.$RANDOM
echo -n 0 >$REPO_SIZE_FILE
declare -A REPO_VERSIONS=( declare -A REPO_VERSIONS=(
["elasticsearch"]="2.x" ["elasticsearch"]="2.x"
["logstash"]="2.3 2.4 5.0" ["logstash"]="2.3 2.4 5.0"
@ -38,3 +41,5 @@ for repo in "${!REPO_VERSIONS[@]}"; do
components=${versions// /,} components=${versions// /,}
"$yum_sync" "${BASE_URL}/${repo}/@{comp}/centos/" 7 "$components" x86_64 "${repo}-@{comp}" "$YUM_PATH" "$yum_sync" "${BASE_URL}/${repo}/@{comp}/centos/" 7 "$components" x86_64 "${repo}-@{comp}" "$YUM_PATH"
done done
"${_here}/helpers/size-sum.sh" $REPO_SIZE_FILE; rm $REPO_SIZE_FILE

View File

@ -1,3 +1,4 @@
#!/bin/bash #!/bin/bash
sz=`bc <$1` sz=$(cat $1)
sz=$(echo $sz | bc)
echo "size-sum:" $(numfmt --to=iec $sz) echo "size-sum:" $(numfmt --to=iec $sz)