summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xups_ctl.sh20
1 files changed, 10 insertions, 10 deletions
diff --git a/ups_ctl.sh b/ups_ctl.sh
index c79648d..9406fa4 100755
--- a/ups_ctl.sh
+++ b/ups_ctl.sh
@@ -1,28 +1,28 @@
#!/bin/sh
/usr/bin/expect -c "spawn ssh localadmin@$1
expect \"password:\"
-send \"99999999\r\"
-expect \"localadmin> \"
+send \"$3\r\"
+expect \"*> \"
send \"device\r\"
-expect \"localadmin> device (VideoRack1)> \"
+expect \"*)> \"
send \"load 1\r\"
-expect \"localadmin> device (VideoRack1)> load (1)> \"
+expect \"*)> load (1)> \"
send \"$2\r\"
expect \"Are you sure? Type \\\"yes\\\" to proceed: \"
send \"yes\r\"
-expect \"localadmin> device (VideoRack1)> load (1)> \"
+expect \"*)> load (1)> \"
send \"exit\r\"
-expect \"localadmin> device (VideoRack1)> \"
+expect \"*)> \"
send \"load 2\r\"
-expect \"localadmin> device (VideoRack1)> load (2)> \"
+expect \"*)> load (2)> \"
send \"$2\r\"
expect \"Are you sure? Type \\\"yes\\\" to proceed: \"
send \"yes\r\"
-expect \"localadmin> device (VideoRack1)> load (2)> \"
+expect \"*)> load (2)> \"
send \"exit\r\"
-expect \"localadmin> device (VideoRack1)> \"
+expect \"*)> \"
send \"exit\r\"
-expect \"localadmin> \"
+expect \"*> \"
send \"exit\r\"
expect \"\0\"
"