]> git.ipfire.org Git - people/ms/network.git/commitdiff
device: add new function device_is_vti6
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Sun, 4 Mar 2018 18:24:56 +0000 (18:24 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 9 Mar 2018 20:19:32 +0000 (20:19 +0000)
This functions checks if a device is a vti6 device.

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.device

index 2de1ad9491f8825511abb782d033696402470cbc..a04111e169e22124481b1242ec356a7e7a8b6598 100644 (file)
@@ -286,6 +286,14 @@ device_is_vti() {
        [ "${type}" = "768" ] && return ${EXIT_OK} || return ${EXIT_ERROR}
 }
 
+device_is_vti6() {
+       local device=${1}
+
+       local type=$(__device_get_file ${device} type)
+
+       [ "${type}" = "769" ] && return ${EXIT_OK} || return ${EXIT_ERROR}
+}
+
 device_get_phy() {
        local device="${1}"