Set nameserver for static IPs
This commit is contained in:
parent
04c195e8b5
commit
9a7915e70c
|
@ -125,6 +125,9 @@ case ${target_netformat} in
|
||||||
formatted_ipaddr="$( sipcalc ${target_ipaddr} | grep -v '(' | awk '/Host address/{ print $NF }' )"
|
formatted_ipaddr="$( sipcalc ${target_ipaddr} | grep -v '(' | awk '/Host address/{ print $NF }' )"
|
||||||
formatted_netmask="$( sipcalc ${target_ipaddr} | grep -v '(' | awk '/Network mask/{ print $NF }' )"
|
formatted_netmask="$( sipcalc ${target_ipaddr} | grep -v '(' | awk '/Network mask/{ print $NF }' )"
|
||||||
target_interfaces_block="auto ${target_interface}\niface ${target_interface} inet ${target_netformat}\n\taddress ${formatted_ipaddr}\n\tnetmask ${formatted_netmask}\n\tgateway ${target_defgw}"
|
target_interfaces_block="auto ${target_interface}\niface ${target_interface} inet ${target_netformat}\n\taddress ${formatted_ipaddr}\n\tnetmask ${formatted_netmask}\n\tgateway ${target_defgw}"
|
||||||
|
cat <<EOF >/etc/resolv.conf
|
||||||
|
nameserver 8.8.8.8
|
||||||
|
EOF
|
||||||
;;
|
;;
|
||||||
'dhcp')
|
'dhcp')
|
||||||
dhclient ${target_interface} >&2
|
dhclient ${target_interface} >&2
|
||||||
|
@ -363,6 +366,10 @@ echo -n "Setting hostname... "
|
||||||
echo "${target_hostname}" | tee ${target}/etc/hostname >&2
|
echo "${target_hostname}" | tee ${target}/etc/hostname >&2
|
||||||
echo "done."
|
echo "done."
|
||||||
|
|
||||||
|
echo -n "Setting resolv.conf... "
|
||||||
|
echo "nameserver 8.8.8.8" | tee ${target}/etc/resolv.conf >&2
|
||||||
|
echo "done."
|
||||||
|
|
||||||
echo -n "Installing GRUB bootloader... "
|
echo -n "Installing GRUB bootloader... "
|
||||||
mount --bind /dev ${target}/dev >&2
|
mount --bind /dev ${target}/dev >&2
|
||||||
mount --bind /dev/pts ${target}/dev/pts >&2
|
mount --bind /dev/pts ${target}/dev/pts >&2
|
||||||
|
|
Loading…
Reference in New Issue