]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/installer/dracut-module/70-dhcpcd.exe
Move installer to its own directory.
[ipfire-2.x.git] / src / installer / dracut-module / 70-dhcpcd.exe
diff --git a/src/installer/dracut-module/70-dhcpcd.exe b/src/installer/dracut-module/70-dhcpcd.exe
new file mode 100755 (executable)
index 0000000..4100fc9
--- /dev/null
@@ -0,0 +1,32 @@
+#/bin/bash
+########################################################################
+# Begin
+#
+# Description : DHCP Client Script (initrd version)
+#
+# Authors     : Arne Fitzenreiter - arne_f@ipfire.org
+#
+# Version     : 02.00
+#
+# Notes       : 
+#
+########################################################################
+
+dhcpcd_up()
+{
+       set | grep "^new_" | sed "s|^new_||g" | \
+       sed "s|'||g" | \
+       sort > /var/ipfire/dhcpc/dhcpcd-$interface.info
+
+       DNS=`grep "domain_name_servers" /var/ipfire/dhcpc/dhcpcd-$interface.info | cut -d"=" -f2`
+       DNS1=`echo $DNS | cut -d" " -f1`
+       DNS2=`echo $DNS | cut -d" " -f2`
+
+       echo "nameserver $DNS1" > /etc/resolv.conf
+       echo "nameserver $DNS2" >> /etc/resolv.conf
+
+}
+
+case "$reason" in
+BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC)       dhcpcd_up;;
+esac