// Panasonic MNO series
TELNET
timeout 600						// ^CAEg 600b.
1:
recv 30 exit 71
unless "Login:" goto 1
sendname						// OC𑗂.
2:
recv 30 exit 72
unless "Password:" goto 2
sendpassword					// pX[h𑗂.
3:
recv 30 exit 73
unless "Command>" goto 3
send "C\r"						// CLIɐ؂ւ.
delay 10
4:
recv 30 exit 74
unless ">" goto 4
send "en\r"						// [hɈڂ.
5:
recv 30 exit 75
unless "#" goto 5
ifpoestscmd goto 20				// Ԏ擾̏ꍇ20ɕ.

/--- ON/OFF/REBOOT䏈 ---/
10:
send "co\r"						// O[oRtBO[V[hֈڂ.
11:		
recv 30 exit 76
unless "(config)#" goto 11
send "in fastethernet0/"		// C^tF[XRtBO[V[hֈڂ,
sendpoeport						// Ώۂ̃|[g𑗂,
send "\r"						// sŏI.
12:
recv 30 exit 77
unless "(config-if)#" goto 12
ifpoeoncmd goto 14				// ON14ɕ.
send "peth shutdown\r"			// POEdR}h𑗂.
ifpoeoffcmd goto 15				// OFF15ɕ.
13:
recv 30 exit 77
unless "(config-if)#" goto 13
waitpoereboot					// u[g܂ł̃EFCgԂ҂.
14:
send "no peth shutdown\r"		// POEdLR}h𑗂.
15:
recv 30 exit 79
unless "(config-if)#" goto 15
goto 30							// I.

/--- Ԏ擾 ---/
20:								// (݂́A[ĥ܂)
send "show peth-port\r"			// |[gݒQƃR}h𑗂.
21:
recv 30 exit 81
unless "More" goto 22			// "More"󂯂,
send "\r"						// CR𑗂đ\.
goto 21
22:
getpoeportno goto 26			// 擪ɂ鐔|[gԍƂĎ擾.
if "Up" goto 23					// "Up"񂪂23֕.
if "Down" goto 25				// "Down"񂪂25֕.
goto 26							// wb_s, RgsȂ.
23:
if "Not Powered" goto 24		// "Up""Not Powered"񂪂24֕.
setpoestson						// dONԂɐݒ.
goto 26
24:
setpoestsnone					// NONEԂɐݒ.
goto 26
25:
setpoestsoff					// dOFFԂɐݒ.
26:
unless "#" goto 21				// "#"܂ōs̉͂JԂ.

/--- Exit ---/
30:
send "logout\r"					// CLI甲.
31:
recv 30 exit 82
unless "Command>" goto 31
send "Q\r"						// R\[ڑI.
exit							// XNvgI.
