You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
659 B
Bash

#!/bin/sh
set -euo pipefail
# Firmware downloader
DEVICE=NE1D
SERIAL=1133001
VERSION=194
BASEURL=https://updates.netool.io/bin/
wget -q --show-progress -O listing.txt $BASEURL
filename=$DEVICE-$VERSION-UP-$SERIAL.bin
rm -f *.bin*
if cat listing.txt | grep $filename > /dev/null && wget -q --show-progress $BASEURL$filename; then
# exact version match
echo $filename > fwname
else
filename=$DEVICE-$VERSION-UP-1133333.bin
if cat listing.txt | grep $filename > /dev/null && wget -q --show-progress $BASEURL$filename; then
echo $filename > fwname
else
echo "ERROR: Unable to find firmware!"
rm fwname
fi
fi