When I execute:
./glis 10 ./config
removes my existing /mnt/gentoo/etc/resolv.conf but
does not write a new one.
The problem seems to stem from this line in 100:
if [ $(ifconfig -a | grep -c eth[0-9]) -gt 0 ]; then
My interface is wlan0 it's defined in the config file
in the variable IFACE_PRE.
I've added a line to grab the DNS server if the domain
is set to DHCP in the config file.
[ "${DOMAIN}" == "DHCP" ] && DNS="$(cat
/etc/dhcpc/dhcp*.info | grep DNS | sort | uniq | tail
-n 1 | cut -d = -f2 | sed "s/'//g")"
Then I added a line to add the new DNS into the resolv.conf
echo "nameserver ${DNS}" >
/mnt/gentoo/etc/resolv.conf
echo "search ${DOMAIN}" >>
/mnt/gentoo/etc/resolv.conf
echo "domain ${DOMAIN}" >>
/mnt/gentoo/etc/resolv.conf
Finally, I moved the lines that build the resolv.conf
OUT of the for loop that spins through the eth*'s since
in my case it would never get triggered.
=C=
Logged In: YES
user_id=25137
The line:
[ "${DOMAIN}" == "DHCP" ] && DNS="$(cat
/etc/dhcpc/dhcp*.info | grep DNS | sort | uniq | tail
-n 1 | cut -d = -f2 | sed "s/'//g")"
Needs to go directly beneath line 35 (echo ${HOSTNAME} >
/mnt/gentoo/etc/hostname || return 1) in functions/100.
=C=
Logged In: YES
user_id=874833
Perhaps a solution to this would be to add a IFACE_POST to
the network configuration variables. This way
100-implement_config wouldn't need to read the ifconfig
output to do it's thing. It could just do what the config
file tells it. A FE could control whether or not the user
could add an interface. This would also allow for something
like:
IFACE_POST[0]="wlan0"
IFACE_IP_POST[0]="192.168.0.22"
IFACE_NETMASK_POST[0]="255.255.255.0"
IFACE_BROADCAST_POST[0]="192.168.0.255"
IFACE_GATEWAY_POST[0]="192.168.0.1" # Optional
Which is currently not possible. What do you think?