Solved

TFTP

Posted on 2008-06-25
2
518 Views
Last Modified: 2010-05-18
Hello,
I'm using Linux Fedora core -6.
Using one shell script I need to download one file from TFTP server.
Script should take IP address and file name with path.
ex. downloadFile.sh 10.10.10.10 /opt/config/file.txt

Can any body help me in writing such script.. specially tftp commands to use in script.

Thanks
0
Comment
Question by:pkgoyal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 14

Accepted Solution

by:
agriesser earned 125 total points
ID: 21868702
Give this one a try.
#!/bin/sh
 
if [ "$#" != "2" ]; then
  echo "usage: $(basename $0) <tftp-server> <remote-file-name>"
  exit 1
fi
 
if echo "get $2 $(basename $2)" | tftp $1 2>&1 | grep -qi "Error code"; then
  exit 1
fi
 
exit 0

Open in new window

0
 
LVL 14

Expert Comment

by:agriesser
ID: 21872167
Just out of interest: Why is a fully functional script just graded with a B??
0

Featured Post

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question