File: lom.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 (56 lines) | stat: -rw-r--r-- 1,197 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
#
# Sun LOM
#
# Verified on (only via ssh so far):
#   Sun v40, Version V2.1.0.16
#
# Examples:
#   over SER MGT RJ-45 (serial via cyclades)
#     device "lom" "lom" "usr-ts:7016"
#   over SER MGT RJ-45 (direct serial)
#     device "lom" "lom" "/dev/ttyS1" "9600,8n1"
#   over NET MGT RJ-45 (network over ssh)
#     device "lom" "lom" "ssh -o StrictHostKeyChecking=no -ladmin sol|&"
#
specification  "lom" {
	timeout 	10

	plug name { "1" }

	# login script handles three cases:
	# 1) serial port, already logged in
	# 2) serial port, not logged in
	# 3) ssh, enter password only
	script login {
		send "\n"
 		expect "\\$|assword:|login: "
		send "admin\n"
		expect "\\$|assword: "
		send "admin\n"
		expect "\\$"
	}
	script status {
		send "platform get power state\n"
		expect "(On|Off)"
		setplugstate "1" $1 on="On" off="Off"
		expect "\\$"
	}
	script on {
		send "platform set power state -W -f -q on\n"
		expect "\\$"
		delay 3
	}
	script off {
		send "platform set power state -W -f -q off\n"
		expect "\\$"
		delay 3
	}
	script cycle {
		send "platform set power state -W -f -q off\n"
		expect "\\$"
		delay 4
		send "platform set power state -W -f -q on\n"
		expect "\\$"
		delay 3
	}
}