ipv4-static: Update hook
[people/stevee/network.git] / src / functions / functions.hook
index 0434f9f..5b82835 100644 (file)
@@ -19,7 +19,8 @@
 #                                                                             #
 ###############################################################################
 
-HOOK_COMMANDS_CONFIG="hook_create hook_down hook_status hook_remove hook_up"
+HOOK_COMMANDS_CONFIG="hook_create hook_down hook_edit hook_status hook_remove"
+HOOK_COMMANDS_CONFIG="${HOOK_COMMANDS_CONFIG} hook_up"
 
 HOOK_COMMANDS_PORT="hook_create hook_down hook_edit hook_hotplug \
        hook_hotplug_rename hook_info hook_status hook_up"
@@ -141,6 +142,19 @@ function hook_list() {
        done
 }
 
+# The default help function.
+function 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 ${EXIT_ERROR}
+       fi
+
+       cli_show_man "${HOOK_MANPAGE}"
+
+       exit $?
+}
+
 function config_get_hook() {
        local config=${1}