]> git.ipfire.org Git - people/stevee/network.git/blobdiff - src/hooks/zones/pppoe
Remove remains of the "real" device type
[people/stevee/network.git] / src / hooks / zones / pppoe
index 3882a2b37ffd528af376d7d03e16b71ea7133c8d..b201ebe7dd19d582044bed11f8ee79e7714a53e7 100644 (file)
@@ -105,7 +105,7 @@ function hook_up() {
        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}")
@@ -121,7 +121,7 @@ function hook_down() {
        local zone=${1}
        assert isset zone
 
-       zone_config_read ${zone}
+       zone_settings_read "${zone}" ${HOOK_SETTINGS}
 
        # Stop the ppp daemon.
        pppd_stop ${zone}
@@ -136,7 +136,8 @@ function hook_down() {
 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
 
@@ -169,7 +170,7 @@ function hook_status() {
 
        cli_device_headline ${zone}
 
-       zone_config_read ${zone}
+       zone_settings_read "${zone}" ${HOOK_SETTINGS}
 
        cli_headline 2 "Configuration"
        cli_print_fmt1 2 "Username" "${USERNAME}"
@@ -227,7 +228,7 @@ function hook_ppp_write_config() {
        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}")
@@ -295,7 +296,7 @@ function hook_port_add() {
                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}
@@ -311,7 +312,7 @@ function hook_port_remove() {
        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}
 }