]> git.ipfire.org Git - people/stevee/network.git/blobdiff - src/header-zone
zone: Allow creating configs which do not require arguments
[people/stevee/network.git] / src / header-zone
index 996d0ac9f852e243f9f1108111b4d9ae24c20100..9a25c0ebab4a854cb16b58d70a74b9da7b2f3fe8 100644 (file)
@@ -29,22 +29,22 @@ function hook_hotplug() {
        exit ${EXIT_NOT_HANDLED}
 }
 
-function hook_create() {
+function hook_new() {
        local zone="${1}"
        assert isset zone
        shift
 
-       settings_read $(zone_dir ${zone})/settings
+       zone_settings_read "${zone}"
 
        hook_parse_cmdline $@
 
-       settings_write $(zone_dir ${zone})/settings ${HOOK_SETTINGS}
+       zone_settings_write "${zone}"
 
        exit ${EXIT_OK}
 }
 
 function hook_edit() {
-       hook_create $@
+       hook_new $@
 }
 
 function hook_remove() {
@@ -102,22 +102,18 @@ function hook_port() {
        exit ${ret}
 }
 
-function hook_port_add() {
+function hook_port_attach() {
        return ${EXIT_NOT_SUPPORTED}
 }
 
-function hook_port_edit() {
+function hook_port_detach() {
        return ${EXIT_NOT_SUPPORTED}
 }
 
-function hook_port_destroy() {
+function hook_port_edit() {
        return ${EXIT_NOT_SUPPORTED}
 }
 
-function hook_port_show() {
-       cmd_not_implemented
-}
-
 function hook_port_status() {
        return ${EXIT_NOT_SUPPORTED}
 }
@@ -204,7 +200,7 @@ function hook_config_cmd() {
 }
 
 function hook_config_create() {
-       assert [ $# -gt 2 ]
+       assert [ $# -ge 2 ]
 
        hook_config_cmd "create" "$@"
 }