copying on to BMCs will never be the same!
Joel Stanley
joel at jms.id.au
Mon Oct 19 13:06:26 AEDT 2015
On Fri, 2015-10-16 at 19:14 +0000, austenc at us.ibm.com wrote:
>
> Having to enter a password is sooo 1999. This expect script will
> take a series of source/destinations and copy them on to a system.
> This is useful when you need to copy files to various directories.
Cool!
Another way to do it is to use rsync and sshpass:
sshpass -p mypassword rsync -rP file1 file2 file3 user at bmc:/tmp/
Cheers,
Joel
>
>
> pushit.exp 9.3.164.147 ipmid /home/root libapphandler.so
> /usr/lib/host-ipmid
>
> If you have access to expect, the script is between the "=" signs
> below...
>
> ========================================
> #!/usr/bin/expect -f
>
> set maxloop "[llength $argv]"
>
> if {$maxloop < 3} {
> puts "USAGE: $argv0 <ip> \[<srcfile> <destination_dir>\] ..."
> exit 1
> }
> set bmcpwd "0penBmc\r"
> set bmcip "[lindex $argv 0]"
> set bmcsystem "root@$bmcip"
>
> for {set i 1} {$i < $maxloop} {incr i 2} {
>
> set cmd "/usr/bin/scp [lindex $argv $i] $bmcsystem:[lindex $argv
> $i+1] "
> puts $cmd
> spawn {*}$cmd;
> expect "password:"
> send $bmcpwd
>
> }
> ========================================
>
>
>
>
>
>
> Chris Austen
> POWER Systems Enablement Manager
> (512) 286-5184 (T/L: 363-5184)
More information about the openbmc
mailing list