4 DESCRIPTION="Preconfiguring networking..."
5 IFFILE="/root/etc/network/interfaces"
7 . /scripts/casper-functions
22 log_begin_msg "$DESCRIPTION"
24 if [ "${STATICIP}" == "frommedia" ] && [ -e "$IFFILE" ] ; then
25 # will use existent /etc/network/interfaces
32 iface lo inet loopback
38 if [ -z "${NETBOOT}" -a -n "${STATICIP}" ] && [ "${STATICIP}" != "frommedia" ]; then
39 parsed=$(echo "${STATICIP}" | sed -e 's/:/ /g')
40 for ifline in ${parsed}; do
41 ifname="$(echo ${ifline} | cut -f1 -d ',')"
42 ifaddress="$(echo ${ifline} | cut -f2 -d ',')"
43 ifnetmask="$(echo ${ifline} | cut -f3 -d ',')"
44 ifgateway="$(echo ${ifline} | cut -f4 -d ',')"
45 cat >> "$IFFILE" <<EOF
47 iface ${ifname} inet static
55 if [ -z "${NETBOOT}" ]; then
56 # default, dhcp assigned
59 # make sure that the preconfigured interface would not get reassigned by dhcp
60 # on startup by ifup script - otherwise our root fs might be disconnected!
64 # iterate the physical interfaces and add them to the interfaces list
65 for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan*; do
66 [ -e $interface ] || continue
67 i="$(basename $interface)"
68 cat >> "$IFFILE" <<EOF
70 iface ${i} inet ${method}