]> git.ipfire.org Git - ipfire-2.x.git/blame - src/installer/dracut-module/70-dhcpcd.exe
Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into seventeen
[ipfire-2.x.git] / src / installer / dracut-module / 70-dhcpcd.exe
CommitLineData
5fca8d27
MT
1#/bin/bash
2########################################################################
3# Begin
4#
5# Description : DHCP Client Script (initrd version)
6#
7# Authors : Arne Fitzenreiter - arne_f@ipfire.org
8#
9# Version : 02.00
10#
11# Notes :
12#
13########################################################################
14
15dhcpcd_up()
16{
17 set | grep "^new_" | sed "s|^new_||g" | \
18 sed "s|'||g" | \
19 sort > /var/ipfire/dhcpc/dhcpcd-$interface.info
20
21 DNS=`grep "domain_name_servers" /var/ipfire/dhcpc/dhcpcd-$interface.info | cut -d"=" -f2`
22 DNS1=`echo $DNS | cut -d" " -f1`
23 DNS2=`echo $DNS | cut -d" " -f2`
24
25 echo "nameserver $DNS1" > /etc/resolv.conf
26 echo "nameserver $DNS2" >> /etc/resolv.conf
27
28}
29
30case "$reason" in
31BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC) dhcpcd_up;;
32esac