Yesterday I had ask how to use my tftp protocol in my bash script:Debian - Using TFTP in a bash scriptAnd now I have a problem with my tftp protocol.The file who was taken depend of my Hostname.So if I put a wrong Hostname, my tftp protocol don't say Hey the file doesn't exist!. He just create an empty file...So it's possible to check if the file exist on my tftp server.Something like this:find 10.1.0.203 /test/${ThisHost}.icaI know this line is not working it's just an example.I want to do something like this in my script:elseThisHost=$(hostname)iffind 10.1.0.203 /test/${ThisHost}.icathentftp 10.1.0.203 << finget /test/${ThisHost}.icaquitfinexec iceweasel /home/rpitc/${ThisHost}.icaelsezenity --error --text=Your Hostname is wrong.fifiSo it's just an example.But if you know how to do that (with real commands), that's would be nice!
Check exist file on another pc
bash;scripting;find;tftp
According to tftp's help you can't:tftp> ?Commands may be abbreviated.  Commands are:connect         connect to remote tftpmode            set file transfer modeput             send fileget             receive filequit            exit tftpverbose         toggle verbose modetrace           toggle packet tracingstatus          show current statusbinary          set mode to octetascii           set mode to netasciirexmt           set per-packet retransmission timeouttimeout         set total retransmission timeout?               print help informationneither you can make a simple ls and see what files you have. TFTP (Trivial FTP) is a very reduced one, so if you need to check files you will have to switch to an ftp server.