summaryrefslogtreecommitdiff
path: root/templates/service/dns/forwarding/ignore-interface/node.def
blob: f3c8083200927048b446390f23710d7b40186c72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
multi:
type: txt
help: Set interface to ignore DNS queries on
syntax:expression: exec "
        intf_array=($(awk '$1 ~ /:$/ { print $1 }' /proc/net/dev))
        intf_array_len=${#intf_array[*]}
        i=0
        while [ $i -lt $intf_array_len ]; do
             if [ \"${intf_array[$i]}\" == \"$VAR(@):\" ] ; then
                   exit 0
             fi
             let i++
        done
        echo Invalid ethernet interface [$VAR(@)]
        exit 1 "

allowed: local -a array ;
         array=($(awk '$1 ~ /:/ { print $1 }' /proc/net/dev));
         echo -n ${array[@]%:*}