Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 393946 Details for
Bug 536432
missing \ in net-setup script, creates invalid /etc/conf.d/net
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Drop bash arrays and allow using ifconfig or iproute2 syntax
net-setup.patch (text/plain), 4.23 KB, created by
Jorge Manuel B. S. Vicetto
on 2015-01-14 09:54:53 UTC
(
hide
)
Description:
Drop bash arrays and allow using ifconfig or iproute2 syntax
Filename:
MIME Type:
Creator:
Jorge Manuel B. S. Vicetto
Created:
2015-01-14 09:54:53 UTC
Size:
4.23 KB
patch
obsolete
>diff --git a/net-setup b/net-setup >index e8a42b5..d93b535 100755 >--- a/net-setup >+++ b/net-setup >@@ -107,32 +107,63 @@ config_ip() { > /sbin/dhcpcd -n -t 10 -h $(hostname) ${iface} & > ;; > 2) >- dialog --visit-items --title "IP address" \ >- --inputbox "Please enter an IP address for ${iface}:" \ >- 20 50 "192.168.1.1" 2> ${iface}.IP >- IP=$(tail -n 1 ${iface}.IP) >- BC_TEMP=$(echo $IP|cut -d . -f 1).$(echo $IP|cut -d . -f 2).$(echo $IP|cut -d . -f 3).255 >- dialog --visit-items --title "Broadcast address" \ >- --inputbox "Please enter a Broadcast address for ${iface}:" \ >- 20 50 "${BC_TEMP}" 2> ${iface}.BC >- BROADCAST=$(tail -n 1 ${iface}.BC) >- dialog --visit-items --title "Network mask" \ >- --inputbox "Please enter a Network Mask for ${iface}:" \ >- 20 50 "255.255.255.0" 2> ${iface}.NM >- NETMASK=$(tail -n 1 ${iface}.NM) >- dialog --visit-items --title "Gateway" \ >- --inputbox "Please enter a Gateway for ${iface} (hit enter for none:)" \ >- 20 50 2> ${iface}.GW >- GATEWAY=$(tail -n 1 ${iface}.GW) >+ >+ dialog --visit-items --title "TCP/IP setup" \ >+ --menu "Do you want to use ifconfig (192.168.0.1 255.255.255.0) or iproute2 (192.168.0.1/24) syntax?. Choose one option:" \ >+ 20 60 7 1 "Use ifconfig to configure the network" \ >+ 2 "Use iproute2 to configure the network" 2> ${iface}.SYNTAX >+ SYNTAX=$(tail -n 1 ${iface}.SYNTAX) >+ case ${SYNTAX} in >+ 1) >+ >+ dialog --visit-items --title "IP address" \ >+ --inputbox "Please enter an IP address for ${iface}:" \ >+ 20 50 "192.168.1.1" 2> ${iface}.IP >+ IP=$(tail -n 1 ${iface}.IP) >+ BC_TEMP=$(echo $IP|cut -d . -f 1).$(echo $IP|cut -d . -f 2).$(echo $IP|cut -d . -f 3).255 >+ dialog --visit-items --title "Broadcast address" \ >+ --inputbox "Please enter a Broadcast address for ${iface}:" \ >+ 20 50 "${BC_TEMP}" 2> ${iface}.BC >+ BROADCAST=$(tail -n 1 ${iface}.BC) >+ dialog --visit-items --title "Network mask" \ >+ --inputbox "Please enter a Network Mask for ${iface}:" \ >+ 20 50 "255.255.255.0" 2> ${iface}.NM >+ NETMASK=$(tail -n 1 ${iface}.NM) >+ dialog --visit-items --title "Gateway" \ >+ --inputbox "Please enter a Gateway for ${iface} (hit enter for none:)" \ >+ 20 50 2> ${iface}.GW >+ GATEWAY=$(tail -n 1 ${iface}.GW) >+ >+ ifconfig ${iface} ${IP} broadcast ${BROADCAST} netmask ${NETMASK} >+ >+ if [ -n "${GATEWAY}" ] >+ then >+ route add default gw ${GATEWAY} dev ${iface} netmask 0.0.0.0 metric 1 >+ fi >+ ;; >+ 2) >+ >+ dialog --visit-items --title "IP address" \ >+ --inputbox "Please enter an IP address for ${iface}:" \ >+ 20 50 "192.168.1.1/24" 2> ${iface}.IP >+ IP=$(tail -n 1 ${iface}.IP) >+ dialog --visit-items --title "Gateway" \ >+ --inputbox "Please enter a Gateway for ${iface} (hit enter for none:)" \ >+ 20 50 2> ${iface}.GW >+ GATEWAY=$(tail -n 1 ${iface}.GW) >+ >+ ip addr add ${IP} dev ${iface} >+ >+ if [ -n "${GATEWAY}" ] >+ then >+ ip route add default via ${GATEWAY} >+ fi >+ esac >+ > dialog --visit-items --title "DNS server"\ > --inputbox "Please enter a name server to use (hit enter for none:)" \ > 20 50 2> ${iface}.DNS > DNS=$(tail -n 1 ${iface}.DNS) >- ifconfig ${iface} ${IP} broadcast ${BROADCAST} netmask ${NETMASK} >- if [ -n "${GATEWAY}" ] >- then >- route add default gw ${GATEWAY} dev ${iface} netmask 0.0.0.0 metric 1 >- fi > if [ -n "${DNS}" ] > then > dialog --visit-items --title "DNS Search Suffix" \ >@@ -181,7 +212,7 @@ write_wireless_conf() { > : > ;; > esac >- echo "preferred_aps=( \"${SSID}\" )" >> /etc/conf.d/net >+ echo "preferred_aps=\"${SSID}\"" >> /etc/conf.d/net > echo "associate_order=\"forcepreferredonly\"" >> /etc/conf.d/net > fi > } >@@ -202,10 +233,10 @@ write_net_conf() { > GATEWAY=$(tail -n 1 ${iface}.GW) > if [ -n "${IP}" -a -n "${BROADCAST}" -a -n "${NETMASK}" ] > then >- echo "config_${iface}=( \"${IP} broadcast ${BROADCAST} netmask ${NETMASK}\" )" >> /etc/conf.d/net >+ echo "config_${iface}=\"${IP} broadcast ${BROADCAST} netmask ${NETMASK}\"" >> /etc/conf.d/net > if [ -n "${GATEWAY}" ] > then >- echo "routes_${iface}=( \"default via ${GATEWAY}\" )" >> /etc/conf.d/net >+ echo "routes_${iface}=\"default via ${GATEWAY}\"" >> /etc/conf.d/net > fi > fi > ;;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 536432
:
393846
| 393946