local zone=${1}
assert isset zone
- zone_config_read ${zone}
+ zone_settings_read "${zone}" ${HOOK_SETTINGS}
# Bring up the port.
local port=$(__hook_get_port "${zone}")
local zone=${1}
assert isset zone
- zone_config_read ${zone}
+ zone_settings_read "${zone}" ${HOOK_SETTINGS}
# Stop the ppp daemon.
pppd_stop ${zone}
function hook_discover() {
local device=${1}
- if [ "$(device_get_type ${device})" != "real" ]; then
+ # This obviously only works on ethernet (or compatible) devices
+ if ! device_is_ethernet_compatible "${device}"; then
exit ${EXIT_ERROR}
fi
cli_device_headline ${zone}
- zone_config_read ${zone}
+ zone_settings_read "${zone}" ${HOOK_SETTINGS}
cli_headline 2 "Configuration"
cli_print_fmt1 2 "Username" "${USERNAME}"
assert isset file
# Read in the configuration files.
- zone_config_read ${zone}
+ zone_settings_read "${zone}" ${HOOK_SETTINGS}
# A port has to be assigned for this action
local port=$(__hook_get_port "${zone}")
return ${EXIT_ERROR}
fi
- config_write "$(zone_dir "${zone}")/ports/${port}"
+ zone_port_settings_write "${zone}" "${port}"
log INFO "Port '${port}' has been added to zone '${zone}'"
exit ${EXIT_OK}
port_down "${port}"
log INFO "Port '${port}' has been removed from zone '${zone}'"
- config_remove "$(zone_dir "${zone}")/ports/${port}"
+ zone_port_settings_remove "${zone}" "${port}"
exit ${EXIT_OK}
}