#!/bin/sh /usr/bin/expect -c "spawn ssh localadmin@$1 expect \"password:\" send \"$3\r\" expect -timeout 60 \"localadmin>\" send \"device\r\" expect \"*)> \" send \"load 1\r\" expect \"*)> load (1)> \" send \"$2\r\" expect \"Are you sure? Type \\\"yes\\\" to proceed: \" send \"yes\r\" expect \"*)> load (1)> \" send \"exit\r\" expect \"*)> \" send \"load 2\r\" expect \"*)> load (2)> \" send \"$2\r\" expect \"Are you sure? Type \\\"yes\\\" to proceed: \" send \"yes\r\" expect \"*)> load (2)> \" send \"exit\r\" expect \"*)> \" send \"exit\r\" expect \"*> \" send \"exit\r\" expect \"\0\" "