This fixes a bug when $CISCO_DEF_DOMAIN contains multiple domains. When
resolv.conf has a line like this:
domain example.com example.org
...then the "host" command fails:
$ host web001
host: parse of /etc/resolv.conf failed
This patch makes vpnc-script use the first entry in CISCO_DEF_DOMAIN for
the "domain" entry.
Signed-off-by: Corey Hickey <bugfood-ml@fatooh.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
# and will be overwritten by vpnc
# as long as the above mark is intact"
+ # If multiple domains are listed, prefer the first for "domain".
+ DOMAIN="${CISCO_DEF_DOMAIN%% *}"
# Remember the original value of CISCO_DEF_DOMAIN we need it later
CISCO_DEF_DOMAIN_ORIG="$CISCO_DEF_DOMAIN"
# Don't step on INTERNAL_IP4_DNS value, use a temporary variable
fi
;;
domain*)
- if [ -n "$CISCO_DEF_DOMAIN" ]; then
- LINE="domain $CISCO_DEF_DOMAIN"
- CISCO_DEF_DOMAIN=""
+ if [ -n "$DOMAIN" ]; then
+ LINE="domain $DOMAIN"
fi
;;
esac