mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-11 19:55:52 +02:00
33 lines
783 B
Plaintext
Executable File
33 lines
783 B
Plaintext
Executable File
#/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
|