# #
###############################################################################
-function hook_dir() {
+hook_dir() {
local type=${1}
if [ -n "${type}" ]; then
}
NETWORK_HOOKS_DIR_ZONES="$(hook_dir zone)"
-function hook_list() {
+hook_list() {
local type="${1}"
assert isoneof type port zone
return ${EXIT_OK}
}
-function hook_exists() {
+hook_exists() {
local type=${1}
local hook=${2}
[ ! -d "${hook}" ] && [ -x "${hook}" ]
}
-function hook_exec() {
+hook_exec() {
local type="${1}"
assert isset type
return ${ret}
}
-function hook_list() {
+hook_list() {
local type="${1}"
local dir="$(hook_dir "${type}")"
}
# The default help function.
-function hook_help() {
+hook_help() {
# If no man page has been configured, we print an error message.
if [ -z "${HOOK_MANPAGE}" ]; then
error "There is no help available for hook '${HOOK}'. Exiting."
exit $?
}
-function config_get_hook() {
+config_get_hook() {
local config=${1}
assert isset config
)
}
-function hook_zone_exists() {
+hook_zone_exists() {
hook_exists zone $@
}
-function hook_zone_exec() {
+hook_zone_exec() {
hook_exec zone $@
}
-function hook_zone_get_all() {
+hook_zone_get_all() {
hook_list zone
}
-function hook_config_exists() {
+hook_config_exists() {
hook_exists config $@
}
-function hook_config_exec() {
+hook_config_exec() {
hook_exec config $@
}
-function hook_config_get_all() {
+hook_config_get_all() {
hook_list config
}
-function hook_valid_command() {
+hook_valid_command() {
local type="${1}"
local cmd="${2}"
return ${EXIT_FALSE}
}
-function hook_valid_command_config() {
+hook_valid_command_config() {
local cmd="${1}"
case "${cmd}" in
return ${EXIT_FALSE}
}
-function hook_valid_command_port() {
+hook_valid_command_port() {
local cmd="${1}"
case "${cmd}" in
return ${EXIT_FALSE}
}
-function hook_valid_command_zone() {
+hook_valid_command_zone() {
local cmd="${1}"
case "${cmd}" in