/etc/powerman/baytech.dev is in powerman 2.3.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | #
# $Id: baytech.dev 866 2008-05-21 20:42:37Z garlick $
#
# Baytech RPC-3 - old style model (not "NC")
#
# Tested the following firmware versions:
# Revision F 5.00, (C) 2001
# Revision F 5.01, (C) 2001
# Assumes:
# 1. command confirmation : disabled (3/configuration, 6/outlets, 2/...)
# 2. admin account password : "baytech" (2/manage users, 2/admin, 1/...)
# 3. net: prompt for password : enabled (3/configuration, 5/access, 2/...)
# Note: prompt is not returned until device is ready to accept another commmand
#
specification "baytech" {
timeout 10 # about 5 sec for cycle command
pingperiod 90
plug name { "1" "2" "3" "4" "5" "6" "7" "8" }
script ping {
send "\r\n"
expect ">"
}
script login {
expect "\n"
expect "Enter password>"
send "baytech\r\n"
expect "Enter Selection>"
send "1\r\n"
expect ">"
}
script logout {
send "menu\r\n"
expect "Enter Selection>"
send "6\r\n"
}
script status_all {
send "status\r\n"
expect "Circuit Breaker:[^\n]*\r\n"
foreachplug {
expect "([0-9]+)[ ]+(On|Off)"
setplugstate $1 $2 on="On" off="Off"
}
expect ">"
}
script on {
send "on %s\r\n"
expect ">"
}
script on_all {
send "on 0\r\n"
expect ">"
}
script off {
send "off %s\r\n"
expect ">"
}
script off_all {
send "off 0\r\n"
expect ">"
}
# If outlet is initially off, "reboot" will leave it off.
# This doesn't match PowerMan's semantics for cycle, so explicitly power
# off then on.
script cycle {
send "off %s\r\n"
expect ">"
delay 4
send "on %s\r\n"
expect ">"
}
script cycle_all {
send "off 0\r\n"
expect ">"
delay 4
send "on 0\r\n"
expect ">"
}
}
|