blob: 8495a59a2df9fc501c379a5f03e1fad11a041cb2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#!/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\"
"
|