Skip to content

Commit

Permalink
Add support for ARM architecture (Unimatrix0#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
nemchik authored and Unimatrix0 committed Mar 13, 2018
1 parent 0b7974e commit ae47c73
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions update_ombi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ]
Expand All @@ -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
Expand All @@ -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!"
Expand Down Expand Up @@ -334,4 +341,4 @@ elif [ $seconds -eq 1 ]; then
fi
durationmsg="Update complete...elapsed time $duration..."
durationmsg="${durationmsg// / }"
.log 6 "$durationmsg"
.log 6 "$durationmsg"

0 comments on commit ae47c73

Please sign in to comment.