20180929 first commit

This commit is contained in:
lishu
2018-09-29 14:57:32 +08:00
commit 19cfcaf353
1283 changed files with 2427387 additions and 0 deletions

42
src/tool/scripts/kscp Normal file
View File

@@ -0,0 +1,42 @@
#!/usr/bin/expect -f
if {$argc != 5} {
puts "usage example:./kscp test.tgz 10.52.202.1 /home/ user 'passwd'"
exit
}
set filename [lindex $argv 0]
set sip [lindex $argv 1]
set dir [lindex $argv 2]
set user [lindex $argv 3]
set passwd [lindex $argv 4]
set logfile "kscp.log"
set timeout 5
spawn scp $filename $user@$sip:$dir
sleep 5
expect {
"(yes/no)?"
{
send "yes\r"
expect "*password:"
send "$passwd\r"
}
"*password:"
{
send "$passwd\r"
}
"Connection closed by remote host"
{
system echo " " $sip " " closed >> $logfile
}
"No route to host"
{
system echo " " $sip " " no host >> $logfile
}
timeout
{
system echo " " $sip " " timeout >> $logfile
}
}
expect eof