Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Simple script to ping and then atftp a firmware image e.g. openwrt or dd-wrt
#!/bin/bash
# Simple script to ping and then atftp a firmware image
# Works on my machine and an ASUS WL-500g series router
# Usage: ./ping_atftp 192.168.1.1 openwrt-brcm47xx-squashfs.trx
EXPECTED_ARGS=2
if [ $# -ne $EXPECTED_ARGS ]; then
echo "Usage: `basename $0` ip-addr firmware-image"
exit 1;
fi
count=50
while [[ $count -ne 0 ]] ; do
ping -w 1 -l 3 -i 0.2 -t 0.01 -c 1 $1
rc=$?
if [[ $rc -eq 0 ]] ; then
count=1
fi
((count=count-1))
done
if [[ $rc -eq 0 ]] ; then
echo "The router is online."
atftp -p -l $2 --trace --verbose $1
else
echo "Timeout."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.