]> git.ipfire.org Git - people/ms/network.git/commitdiff
pppoe: Bring up port when zone is coming up
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 16 Sep 2018 11:50:30 +0000 (12:50 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 16 Sep 2018 11:50:30 +0000 (12:50 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/hooks/zones/pppoe

index 021d89b2dd5ff1ea1efb9284ff3bf27663ce4ac4..e113c92ea9751198db7d6a9cea58ab488a32da8c 100644 (file)
@@ -363,6 +363,36 @@ hook_port_detach() {
        exit ${EXIT_OK}
 }
 
+hook_port_up() {
+       assert [ $# -eq 2 ]
+
+       local zone="${1}"
+       local port="${2}"
+
+       # Try bringing up the port if it has not been brought up before
+       if ! device_exists "${port}"; then
+               port_create "${port}"
+       fi
+
+       # Make sure that the port is up
+       port_up "${port}"
+
+       exit ${EXIT_OK}
+}
+
+hook_port_down() {
+       assert [ $# -eq 2 ]
+
+       local zone="${1}"
+       local port="${2}"
+
+       if device_exists "${port}"; then
+               port_down "${port}"
+       fi
+
+       exit ${EXIT_OK}
+}
+
 hook_ppp_ipv6_up() {
        local zone="${1}"