#!/bin/bash
#  This replaces the /etc/resolv.conf provided by DHCP with
#  one more to our liking.   It uses the school domain as the
#  default search domain, and the school DNS server is used first...

# don't let localhost try to do dns if local dns is not running
systemctl status named.service || return 0

logger "changing /etc/resolv.conf for principal school server"

#  You could place this info into the nameserver forwarders file...
#  grep nameserver /etc/resolv.conf | tail -2 > /tmp/$$
#
#  For now, simply overwrite the DHCP supplied addresses with
#  our own.
cp /etc/sysconfig/olpc-scripts/resolv.conf /etc/resolv.conf

# cat /tmp/$$ >> /etc/resolv.conf
# rm /tmp/$$
