Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bsdinstall/scripts/netconfig_ipv6
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | |||||
# | # | ||||
# TODO: | # TODO: | ||||
# - Add DHCPv6 support once FreeBSD ships with it. | # - Add DHCPv6 support once FreeBSD ships with it. | ||||
# | # | ||||
INTERFACE=$1 | INTERFACE=$1 | ||||
case "${INTERFACE}" in | case "${INTERFACE}" in | ||||
"") bsddialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' \ | "") bsddialog --backtitle "$OSNAME Installer" --title 'Network Configuration' \ | ||||
--msgbox 'No interface specified for IPv6 configuration.' 0 0 | --msgbox 'No interface specified for IPv6 configuration.' 0 0 | ||||
exit 1 | exit 1 | ||||
;; | ;; | ||||
esac | esac | ||||
AGAIN="" | AGAIN="" | ||||
while : ; do | while : ; do | ||||
MSG="Would you like to try stateless address autoconfiguration (SLAAC)${AGAIN}?" | MSG="Would you like to try stateless address autoconfiguration (SLAAC)${AGAIN}?" | ||||
bsddialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' \ | bsddialog --backtitle "$OSNAME Installer" --title 'Network Configuration' \ | ||||
--yesno "${MSG}" 0 0 | --yesno "${MSG}" 0 0 | ||||
if [ $? -eq $BSDDIALOG_OK ]; then | if [ $? -eq $BSDDIALOG_OK ]; then | ||||
if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then | if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then | ||||
bsddialog --backtitle 'FreeBSD Installer' \ | bsddialog --backtitle "$OSNAME Installer" \ | ||||
--infobox "Sending Router Solicitation ..." 0 0 | --infobox "Sending Router Solicitation ..." 0 0 | ||||
ifconfig ${INTERFACE} inet6 -ifdisabled accept_rtadv up | ifconfig ${INTERFACE} inet6 -ifdisabled accept_rtadv up | ||||
err=$( rtsol -F $INTERFACE 2>&1 ) | err=$( rtsol -F $INTERFACE 2>&1 ) | ||||
if [ $? -ne 0 ]; then | if [ $? -ne 0 ]; then | ||||
f_dprintf "%s" "$err" | f_dprintf "%s" "$err" | ||||
bsddialog --backtitle 'FreeBSD Installer' --msgbox "SLAAC failed." 0 0 | bsddialog --backtitle "$OSNAME Installer" --msgbox "SLAAC failed." 0 0 | ||||
AGAIN=" again" | AGAIN=" again" | ||||
continue | continue | ||||
fi | fi | ||||
fi | fi | ||||
echo ifconfig_${INTERFACE}_ipv6=\"inet6 accept_rtadv\" >> $BSDINSTALL_TMPETC/._rc.conf.net | echo ifconfig_${INTERFACE}_ipv6=\"inet6 accept_rtadv\" >> $BSDINSTALL_TMPETC/._rc.conf.net | ||||
exit 0 | exit 0 | ||||
else | else | ||||
break | break | ||||
Show All 23 Lines | END { | ||||
n++; | n++; | ||||
# Nasty trick adding a (hidden, same y) read-only field as a marker | # Nasty trick adding a (hidden, same y) read-only field as a marker | ||||
# to separate interface address(es) from the default router. | # to separate interface address(es) from the default router. | ||||
printf "\"Default Router\" %d 1 \"%s\" %d 1 14 14 2 ", n, "DefaultRouter", n; | printf "\"Default Router\" %d 1 \"%s\" %d 1 14 14 2 ", n, "DefaultRouter", n; | ||||
printf "\"Default Router\" %d 1 \"%s\" %d 16 50 50 0 ", n, dfr, n; | printf "\"Default Router\" %d 1 \"%s\" %d 16 50 50 0 ", n, dfr, n; | ||||
}'` | }'` | ||||
exec 3>&1 | exec 3>&1 | ||||
IF_CONFIG=$(echo ${ADDRS} | xargs -o bsddialog --backtitle 'FreeBSD Installer' \ | IF_CONFIG=$(echo ${ADDRS} | xargs -o bsddialog --backtitle "$OSNAME Installer" \ | ||||
--title 'Network Configuration' \ | --title 'Network Configuration' \ | ||||
--mixedform 'Static IPv6 Network Interface Configuration' 0 0 0 \ | --mixedform 'Static IPv6 Network Interface Configuration' 0 0 0 \ | ||||
2>&1 1>&3) | 2>&1 1>&3) | ||||
if [ $? -eq $BSDDIALOG_CANCEL ]; then exit 1; fi | if [ $? -eq $BSDDIALOG_CANCEL ]; then exit 1; fi | ||||
exec 3>&- | exec 3>&- | ||||
echo ${IF_CONFIG} | tr ' ' '\n' | \ | echo ${IF_CONFIG} | tr ' ' '\n' | \ | ||||
awk -v iface="${INTERFACE}" ' | awk -v iface="${INTERFACE}" ' | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |