Files
2024-10-14 00:08:40 +02:00

23 lines
434 B
Bash

#!/usr/bin/expect
set USER [lindex $argv 0]
set PASSWD [lindex $argv 1]
set SSHHOST [lindex $argv 2]
set TFTP [lindex $argv 3]
set DATE [lindex $argv 4]
spawn ssh $SSHHOST -l $USER
expect "password"
send "$PASSWD\r"
expect "continue"
send "\r"
expect "#"
send "copy command-output \"show tech\" tftp $TFTP $DATE/$SSHHOST/SH-TECH.txt\r"
expect "#"
send "logout\r"
expect "log out";
send "y\r";
expect eof
exit