Skip to content

Instantly share code, notes, and snippets.

@mvaz
Created August 12, 2013 09:25
Show Gist options
  • Select an option

  • Save mvaz/6209445 to your computer and use it in GitHub Desktop.

Select an option

Save mvaz/6209445 to your computer and use it in GitHub Desktop.
Upload dd-wrt firmware to a router. IP address 192.168.11.1 and the firmware is in dd-wrt.v24_std_generic.bin .
#!/usr/bin/env bash
echo 'Begin ping'
if ping -oc 10 192.168.11.1 > /dev/null; then
echo 'the Internet is back up'
echo '>> tftp 192.168.11.1 put dd-wrt.v24_std_generic.bin'
echo -n "put dd-wrt.v24_std_generic.bin" | tftp -e 192.168.11.1
echo 'done'
else
echo 'timeout. Abort'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment