From ae47c73e9c764c0140fe5a6ff794fd24e6f2da8f Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Tue, 13 Mar 2018 10:40:40 -0500 Subject: [PATCH] Add support for ARM architecture (#28) --- update_ombi.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/update_ombi.sh b/update_ombi.sh index d73f4df..3a4dca3 100644 --- a/update_ombi.sh +++ b/update_ombi.sh @@ -54,6 +54,8 @@ declare -i verbosity=-1 name="update_ombi" version="1.1.02" SECONDS=0 +arch=$(uname -m) +archshort=${arch:0:3} while [ $# -gt 0 ]; do case "$1" in @@ -172,6 +174,11 @@ if [ -z "${port}" ]; then fi .log 6 "Downloading Ombi update..." +if [ "$archshort" = 'arm' ]; then + filename='linux-arm.tar.gz' + else + filename='linux.tar.gz' +fi declare -i i=1 declare -i j=5 while [ $i -le $j ] @@ -192,7 +199,7 @@ do exit 1 fi .log 6 "Latest version: $version...determining expected file size..." - size=$(curl -sL https://ci.appveyor.com/api/buildjobs/$jobId/artifacts | grep -Po '(?<="linux.tar.gz","type":"File","size":)(\d+)') + size=$(curl -sL https://ci.appveyor.com/api/buildjobs/$jobId/artifacts | grep -Po '(?<="'$filename'","type":"File","size":)(\d+)') .log 7 "size: $size" if [ -e $size ]; then if [ $i -lt $j ]; then @@ -213,7 +220,7 @@ do done tempdir=$(mktemp -d) file="$tempdir/ombi_$version.tar.gz" -wget --quiet --show-progress -O $file "https://ci.appveyor.com/api/buildjobs/$jobId/artifacts/linux.tar.gz" +wget --quiet --show-progress -O $file "https://ci.appveyor.com/api/buildjobs/$jobId/artifacts/$filename" .log 6 "Version $version downloaded...checking file size..." if [ $(wc -c < $file) != $size ]; then .log 3 "Downloaded file size does not match expected file size...bailing!" @@ -334,4 +341,4 @@ elif [ $seconds -eq 1 ]; then fi durationmsg="Update complete...elapsed time $duration..." durationmsg="${durationmsg// / }" -.log 6 "$durationmsg" \ No newline at end of file +.log 6 "$durationmsg"