18 lines
630 B
Bash
18 lines
630 B
Bash
#!/bin/sh
|
|
# ifup hook script for resolvconf
|
|
# Written by Roy Marples <roy@marples.name> under the BSD-2 license
|
|
|
|
[ -x /sbin/resolvconf ] || exit 0
|
|
|
|
conf=
|
|
[ -n "$IF_DNS_DOMAIN" ] && conf="${conf}domain $IF_DNS_DOMAIN\n"
|
|
[ -n "$IF_DNS_SEARCH" ] && conf="${conf}search $IF_DNS_SEARCH\n"
|
|
[ -n "$IF_DNS_SORTLIST" ] && conf="${conf}sortlist $IF_DNS_SORTLIST\n"
|
|
[ -n "$IF_DNS_OPTIONS" ] && conf="${conf}options $IF_DNS_OPTIONS\n"
|
|
for nameserver in $IF_DNS_NAMESERVERS; do
|
|
conf="${conf}nameserver $nameserver\n"
|
|
done
|
|
if [ -n "$conf" ]; then
|
|
conf="# Generated by ifup for $IFACE\n$conf"
|
|
printf "$conf" | /sbin/resolvconf -a "$IFACE"
|
|
fi
|