mirror of
https://github.com/bobbimanners/emailler.git
synced 2024-11-19 12:30:51 +00:00
22 lines
570 B
Ruby
22 lines
570 B
Ruby
|
# a q&d hack for tftping down a file and dumping it to std-out
|
||
|
# useful for testing the netboot65 tftp server, especially the hacks for directory listings
|
||
|
|
||
|
|
||
|
require 'net/tftp'
|
||
|
|
||
|
def usage
|
||
|
@progname=File.basename($0)
|
||
|
puts "usage: #{@progname} <servername> <filename>"
|
||
|
puts "specified filename will be downloaded from specified tftp server and dumpt to stdout"
|
||
|
true
|
||
|
end
|
||
|
|
||
|
number_of_options=ARGV.length
|
||
|
usage && exit unless number_of_options==2
|
||
|
servername=ARGV[0]
|
||
|
filename=ARGV[1]
|
||
|
|
||
|
t = Net::TFTP.new(servername)
|
||
|
t.getbinary(filename,$stdout)
|
||
|
|