mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 02:40:08 +00:00
run: plugin for Gembird EnerGenie powerplug
The plugin works just like the netio plugin and uses the following parameters --power-off-energenie-host network address of device --power-off-energenie-password password for device --power-off-energenie-port target port of device
This commit is contained in:
parent
539e5212ab
commit
ebd0796fc0
34
tool/run/power_off/energenie
Normal file
34
tool/run/power_off/energenie
Normal file
@ -0,0 +1,34 @@
|
||||
##
|
||||
# Reset the target machine via EnerGenie poweplug by Gembird
|
||||
#
|
||||
# \param --power-off-energenie-host network address of device
|
||||
# \param --power-off-energenie-password password for device
|
||||
# \param --power-off-energenie-port target port of device
|
||||
#
|
||||
|
||||
|
||||
proc power_off_energenie_host { } {
|
||||
return [get_cmd_arg_first --power-off-energenie-host 1]
|
||||
}
|
||||
|
||||
|
||||
proc power_off_energenie_password { } {
|
||||
return [get_cmd_arg_first --power-off-energenie-password 1]
|
||||
}
|
||||
|
||||
|
||||
proc power_off_energenie_port { } {
|
||||
return [get_cmd_arg_first --power-off-energenie-port 1]
|
||||
}
|
||||
|
||||
|
||||
proc run_power_off { } {
|
||||
set host [power_off_energenie_host]
|
||||
set password [power_off_energenie_password]
|
||||
set power_port [power_off_energenie_port]
|
||||
|
||||
puts "switch port $power_port off"
|
||||
exec curl -s -o /dev/null -d pw=$password http://$host/login.html
|
||||
exec curl -s -o /dev/null -d ctl$power_port=0 http://$host/status.html
|
||||
exec curl -s -o /dev/null http://$host/login.html
|
||||
}
|
36
tool/run/power_on/energenie
Normal file
36
tool/run/power_on/energenie
Normal file
@ -0,0 +1,36 @@
|
||||
##
|
||||
# Reset the target machine via EnerGenie poweplug by Gembird
|
||||
#
|
||||
# \param --power-on-energenie-host network address of device
|
||||
# \param --power-on-energenie-password password for device
|
||||
# \param --power-on-energenie-port target port of device
|
||||
#
|
||||
|
||||
|
||||
proc power_on_energenie_host { } {
|
||||
return [get_cmd_arg_first --power-on-energenie-host 1]
|
||||
}
|
||||
|
||||
|
||||
proc power_on_energenie_password { } {
|
||||
return [get_cmd_arg_first --power-on-energenie-password 1]
|
||||
}
|
||||
|
||||
|
||||
proc power_on_energenie_port { } {
|
||||
return [get_cmd_arg_first --power-on-energenie-port 1]
|
||||
}
|
||||
|
||||
|
||||
proc run_power_on { } {
|
||||
set host [power_on_energenie_host]
|
||||
set password [power_on_energenie_password]
|
||||
set power_port [power_on_energenie_port]
|
||||
|
||||
puts "switch port $power_port on"
|
||||
|
||||
# login - switch - logout
|
||||
exec curl -s -o /dev/null -d pw=$password http://$host/login.html
|
||||
exec curl -s -o /dev/null -d ctl$power_port=1 http://$host/status.html
|
||||
exec curl -s -o /dev/null http://$host/login.html
|
||||
}
|
Loading…
Reference in New Issue
Block a user