diff options
| author | Roy Marples <roy@marples.name> | 2020-01-14 07:06:24 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2020-01-14 07:06:24 +0000 |
| commit | 9c6b0045b9b890f58e6da5bed0af95a4f8eda704 (patch) | |
| tree | 2cc5ca1abf63fbb487d0a3e31117c3042b9b837f | |
| parent | e114fa2672a86a3b827599d4c4c5ec2ead0a94c2 (diff) | |
| download | openresolv-9c6b0045b9b890f58e6da5bed0af95a4f8eda704.tar.xz | |
Add allow_interfaces and deny_interfaces configuration options
Does what it says on the tin.
For example it could be used on routers where DHCP contains
DNS setup which should be ignored as it rolls it's own and you
can't change the DHCP not to setup DNS.
| -rw-r--r-- | resolvconf.conf.5.in | 4 | ||||
| -rw-r--r-- | resolvconf.in | 15 |
2 files changed, 19 insertions, 0 deletions
diff --git a/resolvconf.conf.5.in b/resolvconf.conf.5.in index 989fc80..23296cc 100644 --- a/resolvconf.conf.5.in +++ b/resolvconf.conf.5.in @@ -61,6 +61,10 @@ Set to NO to disable .Nm resolvconf from running any subscribers. Defaults to YES. +.It Sy allow_interfaces +If set, only these interfaces will be processed. +.It Sy deny_interfaces +If set, these interfaces will not be processed. .It Sy interface_order These interfaces will always be processed first. If unset, defaults to the following:- diff --git a/resolvconf.in b/resolvconf.in index 79e23fe..5f537a5 100644 --- a/resolvconf.in +++ b/resolvconf.in @@ -494,6 +494,21 @@ list_resolv() fi continue fi + + if [ -n "$allow_interfaces" ]; then + x=false + for j in $allow_interfaces; do + if [ "$i" = "$j" ]; then + x=true + fi + done + $x || continue + fi + for j in $deny_interfaces; do + if [ "$i" = "$j" ]; then + continue 2 + fi + done if [ "$cmd" = i ] || [ "$cmd" = "-i" ]; then printf %s "$i " |
