File: wti.dev

package info (click to toggle)
powerman 2.4.4-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,432 kB
  • sloc: ansic: 19,458; sh: 7,225; yacc: 694; makefile: 455; lex: 272
file content (63 lines) | stat: -rw-r--r-- 1,168 bytes parent folder | download | duplicates (2)
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
#
# $Id$
#
# WTI NPS
#
# Tested the following firmware versions:
#    v3.02
# Assumes:
# 1. password: "wti" (/g general params, 1 system passwd)
# 2. command confirmation: off (/g general params, 8 command confirmation)
# 3. disconnect timeout: set to max (30 min)
# Note: prompt is not returned until device is ready to accept another command
#
specification "wti" {
	timeout 	30  # "/boot *" command takes about 20 sec

	plug name { "1" "2" "3" "4" "5" "6" "7" "8" }

	script login {
		expect "\n"
		expect "word: "
		send "wti\r\n"
		expect "NPS> "
	}
	script logout {
		send "/x\r\n"
	}
	script status_all {
		send "/s\r\n"
		expect "Default"
		expect "\\+\r\n"
		foreachplug {
			expect " ([0-9]+)[^\n]*(ON|OFF)[^\n]*(ON|OFF)[^\n]*\r\n"
			setplugstate $1 $2 off="OFF" on="ON"
		}
		expect "\\+\r\n"
		expect "NPS> "
	}
	script on {
		send "/on %s\r\n"
		expect "NPS> "
	}
	script on_all {
		send "/on *\r\n"
		expect "NPS> "
	}
	script off {
		send "/off %s\r\n"
		expect "NPS> "
	}
	script off_all {
		send "/off *\r\n"
		expect "NPS> "
	}
	script cycle {
		send "/boot %s\r\n"
		expect "NPS> "
	}
	script cycle_all {
		send "/boot *\r\n"
		expect "NPS> "
	}
}