On Sat, Oct 15, 2022 at 3:21 PM Chuck Hast <[email protected]> wrote: > Folks, > I have some WiFi devices that I am loading code into to convert > them to something called AREDN, Amateur Radio Emergency > Data Network. Most of them use tftp to upload the new image > into the device. After doing several of them I tried to figure out > how to write a small script to do the tftp uploads. The steps are > as follows > kp4djt@kp4djt64:~$ tftp 192.168.1.1 > tftp> bin (set binary transfer) > tftp> trace on (set trace on) > Packet tracing on. (response) > tftp> put /tftp/file.bin (file to send to device) > > At this point it will either start showing blocks being > sent or will time out > I would like to write a script that just runs that, I would > have 2 versions one for devices which default to 192.168.1.1 > and those who use .1.20, then it runs and all I have to do > is either edit it and put the upload file in or have it stop > and I paste/type the file name in and turn it loose. > > Of course as soon as you invoke tftp it jumps into it's own > interface, I googled for writing scripts to control tftp, I saw > some that embed it in a bash script but appears that you > i have to make the tftp entries by hand with those scripts. > > Anyone have any idea of how to write a script to invoke > tftp and insert commands to tftp? >
Don't know about the trace on, but adapted from https://superuser.com/questions/1116413/can-you-tftp-download-a-file-in-one-line tftp -m binary "192.168.1.1" -c put "/tftp/file.bin" Bill
