remove)
cli_zone_remove $@
;;
+ list-hooks)
+ cli_list_hooks zone $@
+ ;;
""|*)
if [ -n "${action}" ]; then
error "Unrecognized argument: '${action}'"
fi
}
+function cli_list_hooks() {
+ local type=${1}
+ shift
+
+ if cli_help_requested $@; then
+ cli_show_man network-zone
+ exit ${EXIT_OK}
+ fi
+
+ local hook_dir=$(hook_dir ${type})
+ local hook
+
+ for hook in ${hook_dir}/*; do
+ hook=$(basename ${hook})
+ if hook_exists ${type} ${hook}; then
+ echo "${hook}"
+ fi
+ done | sort -u
+}
+
# Removes a zone either immediately, if it is currently down,
# or adds a tag that the removal will be done when the zone
# is brought down the next time.
network-zone \- Network Configuration Control Program
.SH SYNOPSIS
-\fBnetwork [OPTIONS] zone create <zone> ...\fR
+\fBnetwork [OPTIONS] zone [create|remove] <zone> ...\fR
+.P
+\fBnetwork [OPTIONS] zone list-hooks\fR
.P
\fBnetwork [OPTIONS] zone <zone> command ...\fR
.RE
.PP
+\fBlist-hooks\fR
+.RS 4
+Outputs a list of all possible hooks for the zones.
+.RE
+.PP
+
For all other commands, the name of the zone needs to be passed first:
\fBnetwork zone <zone> command\fR.