File: create_resolv_conf

package info (click to toggle)
fai 6.5.2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 2,084 kB
  • sloc: sh: 6,712; perl: 5,664; makefile: 138
file content (21 lines) | stat: -rwxr-xr-x 704 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /bin/sh

### BEGIN SUBROUTINE INFO
# Provides-Var:    $DNSSRVS $DOMAIN
# Requires-Var:    none
# Short-Description: <task desc.>
### END SUBROUTINE INFO

# use resolv.conf from dracut's initrd
if [ -f /run/initramfs/state/etc/resolv.conf ]; then
    cp  /run/initramfs/state/etc/resolv.conf /etc/resolv.conf
elif [ "$DNSSRVS" ]; then
    # create a resolv.conf using the DHCP information
    [ "$DOMAIN" ] && echo "domain $DOMAIN" >/etc/resolv.conf
    for dnshost in $DNSSRVS ; do
        echo "nameserver $dnshost" >>/etc/resolv.conf
    done
else
    # use the resolv.conf from the installserver
    [ -f /etc/resolv.conf-installserver ] && cp -p /etc/resolv.conf-installserver /etc/resolv.conf
fi