mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-26 17:01:07 +00:00
539e5212ab
The run plugin is not generic and works for NETIO4/NETIO230 powerplugs only. Further, this opens the path for other vendor-specific powerplug plugins. Note, the plugin parameter for the addressed powerplug was renamed to --power-on-netio-host resp. --power-off-netio-host
46 lines
1.1 KiB
Plaintext
46 lines
1.1 KiB
Plaintext
##
|
|
# Reset the target machine via NETIO4/NETIO230 powerplug by Koukaam
|
|
#
|
|
# \param --power-off-netio-host network address of device
|
|
# \param --power-off-netio-user user for device
|
|
# \param --power-off-netio-password password for device
|
|
# \param --power-off-netio-port target port of device
|
|
#
|
|
|
|
|
|
source [genode_dir]/tool/run/power_netio.inc
|
|
|
|
|
|
proc power_off_netio_host { } {
|
|
return [get_cmd_arg_first --power-off-netio-host 1]
|
|
}
|
|
|
|
|
|
proc power_off_netio_user { } {
|
|
return [get_cmd_arg_first --power-off-netio-user 1]
|
|
}
|
|
|
|
|
|
proc power_off_netio_password { } {
|
|
return [get_cmd_arg_first --power-off-netio-password 1]
|
|
}
|
|
|
|
|
|
proc power_off_netio_port { } {
|
|
return [get_cmd_arg_first --power-off-netio-port 1]
|
|
}
|
|
|
|
|
|
proc run_power_off { } {
|
|
set host [power_off_netio_host]
|
|
set user_name [power_off_netio_user]
|
|
set password [power_off_netio_password]
|
|
set power_port [power_off_netio_port]
|
|
|
|
set connection_id [power_netio_connect $host $user_name $password]
|
|
|
|
puts "switch port $power_port off"
|
|
send -i $connection_id "port $power_port 0\n"
|
|
expect -i $connection_id "250 OK"
|
|
}
|