| 1 |
#! /bin/sh |
| 2 |
|
| 3 |
### BEGIN SUBROUTINE INFO |
| 4 |
# Provides-Var: $DNSSRVS $DOMAIN |
| 5 |
# Requires-Var: none |
| 6 |
# Short-Description: <task desc.> |
| 7 |
### END SUBROUTINE INFO |
| 8 |
|
| 9 |
# use resolv.conf from dracut's initrd |
| 10 |
if [ -f /run/initramfs/state/etc/resolv.conf ]; then |
| 11 |
cp /run/initramfs/state/etc/resolv.conf /etc/resolv.conf |
| 12 |
elif [ "$DNSSRVS" ]; then |
| 13 |
# create a resolv.conf using the DHCP information |
| 14 |
[ "$DOMAIN" ] && echo "domain $DOMAIN" >/etc/resolv.conf |
| 15 |
for dnshost in $DNSSRVS ; do |
| 16 |
echo "nameserver $dnshost" >>/etc/resolv.conf |
| 17 |
done |
| 18 |
else |
| 19 |
# use the resolv.conf from the installserver |
| 20 |
[ -f /etc/resolv.conf-installserver ] && cp -p /etc/resolv.conf-installserver /etc/resolv.conf |
| 21 |
fi |