#!/usr/local/bin/expect -f # dltarget.tcl - Expect script called by dltarget shell script # to download file or dir to /var/tmp on target # # Assumes expect is installed on host, ftpd running on target set tarball [lindex $argv 0] set target [lindex $argv 1] set timeout 60 # ftp tarball to target spawn bash send "ftp $target\r" expect "): " send "root\r" expect "Password:" send "uClinux\r" expect "ftp> " send "cd /var/tmp\r" expect "ftp> " send "put $tarball\r" expect "ftp> " send "quit\r" # untar tarball spawn telnet $target send "cd /var/tmp\r" expect "> " send "tar xvf $tarball\r" expect "> " send "rm -f $tarball\r" expect "> " send "exit\r"