Skip to content

Instantly share code, notes, and snippets.

@hryamzik
Created June 17, 2015 15:34
Show Gist options
  • Save hryamzik/bc063b58f36d985d9da9 to your computer and use it in GitHub Desktop.
Save hryamzik/bc063b58f36d985d9da9 to your computer and use it in GitHub Desktop.
#!/bin/sh -ux
on_die()
{
echo "Dying..."
exit 0
}
trap 'on_die' TERM INT
while ! ping -c 1 -W 1 $1 > /dev/null
do
echo "Waiting for $1"
done
tftp $1 <<EOF
binary
trace
verbose
put $2 firmware.bin
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment