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