haven't quite sorted out better download error handling
This commit is contained in:
parent
b34d77d1fc
commit
1d6831d557
1 changed files with 7 additions and 6 deletions
|
|
@ -92,15 +92,16 @@ fi
|
||||||
|
|
||||||
echo "Atempting to upgrade to: $REMOTE_VERSION"
|
echo "Atempting to upgrade to: $REMOTE_VERSION"
|
||||||
last=130
|
last=130
|
||||||
down_tries=3
|
down_tries=0
|
||||||
if curl --output /dev/null --silent --head --fail "${PLEX_URL}/plex-media-server/$REMOTE_VERSION/plexmediaserver_${REMOTE_VERSION}_amd64.deb"; then
|
while [[ $last -ne "0" ]]; do
|
||||||
while [[ $last -ne "0" ]] || [[ down_tries -gt 0 ]]; do
|
|
||||||
rm -f /tmp/plexmediaserver_*.deb
|
rm -f /tmp/plexmediaserver_*.deb
|
||||||
curl -o /tmp/plexmediaserver_"${REMOTE_VERSION}"_amd64.deb -L \
|
curl -o /tmp/plexmediaserver_"${REMOTE_VERSION}"_amd64.deb -L \
|
||||||
"${PLEX_URL}/plex-media-server/$REMOTE_VERSION/plexmediaserver_${REMOTE_VERSION}_amd64.deb"
|
"${PLEX_URL}/plex-media-server/${REMOTE_VERSION}/plexmediaserver_${REMOTE_VERSION}_amd64.deb"
|
||||||
down_tries=$((down_tries-1))
|
last=$?
|
||||||
last=$?
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# test if deb exists, install it or exit out
|
||||||
|
if [[ $(stat -c %s /tmp/plexmediaserver_"${REMOTE_VERSION}"_amd64.deb) -gt 10000 ]]; then
|
||||||
apt-get remove --purge -y \
|
apt-get remove --purge -y \
|
||||||
plexmediaserver
|
plexmediaserver
|
||||||
dpkg -i /tmp/plexmediaserver_"${REMOTE_VERSION}"_amd64.deb
|
dpkg -i /tmp/plexmediaserver_"${REMOTE_VERSION}"_amd64.deb
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue