# Wifi woes...  [Solved]

## TerranAce007

Well I just got my laptop back after a hell of an RMA process, and I have just discovered that my new neighbors have an unencrypted wifi network that my laptop likes to connect to. For my access point, my essid is "homenetwork" and I have usually used a small shell script I wrote to connect, and never had any problems.

I want to configure the /etc/conf.d/wireless correctly so that my laptop can connect automatically at startup without me having to su, type in the password, and run the shell script all the time, and so I can add entries for other wifi networks that I use with my laptop, such as at my friends house.

This is my script that connects me to my wifi network:

```

iwconfig eth1 mode managed essid homenetwork nickname "mobile" key s:mywepkey

/etc/init.d/net.eth1 restart

```

Now, I tried to replicate these settings in my /etc/conf.d/wireless, and added net.eth1 to battery and default runlevels, however on startup, my laptop keeps connecting to my neighbor's wifi network. If I move to the other side of the house where I can't get his signal, my laptop just hangs waiting for a dhcp response. After it fails to connect and finally finished booting up, I can run my shell script, and it will connect right away, so something is wrong with my /etc/conf.d/wireless (or maybe something else???)...

/etc/conf.d/wireless:

```

essid_eth1="homenetwork"

mode_eth1="managed"

channel_eth1="6"

key_homenetwork="s:mywepkey enc open"

config_homenetwork=("dhcp")

dhcpcd_homenetwork="-t 5"

preferred_aps_eth1=( "homenetwork" )

associate_order="forcepreferredonly"

```

Also, how do I adjust the wait time for the DHCP client? When no wifi is avaliable, my laptop freezes up at boot for over 2 minutes while it waits for a response. I'm not sure what the "-t 5" above does, but I am guessing it is the amount of retries???

----------

## jakubc

just a question...

you do have this in your /etc/conf.d/net right?

```

modules=( "iwconfig" )

```

 The -t switch is this (from "man dhcpcd"):

```

 -t <timeout>

              Specifies  (in  seconds ) for how long dhcpcd will try to get an

              IP address. The default is 60 seconds.   dhcpcd  will  not  fork

              into  background  until it gets a valid IP address in which case

              dhcpcd will return 0 to the parent process.  In  a  case  dhcpcd

              times  out  before receiving a valid IP address from DHCP server

              dhcpcd will return exit code 1 to the parent process.

```

so it's the timeout (the fact that you have it set to 5 seconds, and it's waiting for 2 minutes says that the settings in /etc/conf.d/wireless are not being read (that at least is my assumption) ).

I hope this helped... being a n00b I do the best I can  :Smile: 

----------

## TerranAce007

Well, I put that line in both wireless and net files, and my laptop connects to my neighbors network every time it gets the signal, and just hangs when it does not...

----------

## jakubc

ok...

reading through your post I saw one thing I missed earlier... in your script *Quote:*   

> iwconfig eth1 mode managed essid homenetwork nickname "mobile" key s:mywepkey
> 
> /etc/init.d/net.eth1 restart 

 you don't have the channle set... is your AP set to channel 6 as it says in your /etc/conf.d/wireless?

oh and you can take the 

```

modules=( "iwconfig" )

```

line out of your /etc/conf.d/wireless file... this line tells the /etc/conf.d/net settings to use iwconfig settings... so there is no need to have it in .../wireless.

otherwise I see no reason to have this problem, your settings are good... you might want to try the AP without WEP... just to see if it works that way (pinpoint the problem... a lot of people I whose posts I saw on this forum try it that way...)

also does simply running 

```
/etc/init.d/net.eth1 start
```

work, or does it produce the same results as startup (sometimes my wireless didn't catch on when i was booting but running this script again after boot helped)?

best of luck!

----------

## TerranAce007

If I just type '/etc/init.d/net.eth1 start' then the dhcp server hangs like it does on startup and does not connect. To connet manually, I have to do the iwconfig command first, then start net.eth1. My script already works (I don't need to specify the channel number, which is 6), and I am able to connect with WEP.

My script:

```

iwconfig eth1 mode managed essid homenetwork nickname "mobile" key s:wepkey

/etc/init.d/net.eth1 restart

```

Result:

```

mobile andrew # sh wifi.sh

 * Bringing eth1 down

 *   Removing inet6 addresses

 *     eth1 inet6 del fe80::20e:35ff:fe63:ea06/64...                      [ ok ]

 *   Stopping eth1...                                                     [ ok ]

 *    Bringing eth1 up via DHCP...                                           [ ok ]

 *   eth1 received address 192.168.1.2

mobile andrew #

```

The problem I am having is not that I can't get WEP working, but that the settings I put into /etc/conf.d/wireless don't seem to be accesed, and my laptop either hangs and fails to connect or connects to my neighbor's unencrypted network. I can connect fine right now manually through the command line or my script, but I want to be able to connect on startup to any available wifi network, with my own network as the preferred network. I messed with the timeout settings so it doesn't hang my laptop for 2 minutes, but it still doesn't see my router.

Here is my /etc/conf.d/net:

```

# /etc/conf.d/net:

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $

# Global config file for net.* rc-scripts

modules=( "iwconfig" )

iface_eth0="dhcp"

iface_eth1="dhcp"

#gateway="eth0/192.168.1.1"

dhcpcd_eth0="-t 10 -h `cat /etc/hostname`"

dhcpcd_eth1="-t 10 -h `cat /etc/hostname`"

```

BTW, I have seen ifconfig_eth0=( "dhcp" ) used instead of the iface_eth0="dhcp" which was from the Gentoo handbook. What is the difference?

/etc/conf.d/wireless:

```

essid_eth1="homenetwork"

mode_eth1="managed"

#sleep_scan_eth1="10"

#associate_test_eth1="MAC"

#scan_mode_eth1="managed"

key_homenetwork="s:wepkey enc open"

config_homenetwork=("dhcp")

dhcpcd_homenetwork="-t 5"

preferred_aps=( "homenetwork" )

```

eth0 is my Sis900 LAN card and eth1 is my Intel ipw2200 wifi card. I have done tons of searching on google and cannot find any thorough guides to settings wifi up, but what I have found I have already tried, and it still doesn't work like I want it to...

/etc/init.d/net.eth1

```

#!/sbin/runscript

# Copyright 1999-2004 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License v2

# $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/net.eth0,v 1.41 2004/05/10 14:16:35 agriffis Exp $

#NB: Config is in /etc/conf.d/net

if [[ -n $NET_DEBUG ]]; then

        set -x

        devnull=/dev/stderr

else

        devnull=/dev/null

fi

# For pcmcia users. note that pcmcia must be added to the same

# runlevel as the net.* script that needs it.

depend() {

        use hotplug pcmcia

}

checkconfig() {

        if [[ -z "${ifconfig_IFACE}" ]]; then

                eerror "Please make sure that /etc/conf.d/net has \$ifconfig_$IFACE set"

                eerror "(or \$iface_$IFACE for old-style configuration)"

                return 1

        fi

        if [[ -n "${vlans_IFACE}" && ! -x /sbin/vconfig ]]; then

                eerror "For VLAN (802.1q) support, emerge net-misc/vconfig"

                return 1

        fi

}

# Fix bug 50039 (init.d/net.eth0 localization)

# Some other commands in this script might need to be wrapped, but

# we'll get them one-by-one.  Note that LC_ALL trumps LC_anything_else

# according to locale(7)

ifconfig() {

        LC_ALL=C /sbin/ifconfig "$@"

}

# setup_vars: setup variables based on $1 and content of /etc/conf.d/net

# The following variables are set, which should be declared local by

# the calling routine.

#       status_IFACE                    (up or '')

#       vlans_IFACE                             (space-separated list)

#       ifconfig_IFACE                  (array of ifconfig lines, replaces iface_IFACE)

#       dhcpcd_IFACE                    (command-line args for dhcpcd)

#       routes_IFACE                    (array of route lines)

#       inet6_IFACE                             (array of inet6 lines)

#       ifconfig_fallback_IFACE (fallback ifconfig if dhcp fails)

setup_vars() {

        local i iface="${1//\./_}"

        status_IFACE="$(ifconfig ${1} 2>${devnull} | gawk '$1 == "UP" {print "up"}')"

        eval vlans_IFACE=\"\$\{iface_${iface}_vlans\}\"

        eval ifconfig_IFACE=( \"\$\{ifconfig_$iface\[@\]\}\" )

        eval dhcpcd_IFACE=\"\$\{dhcpcd_$iface\}\"

        eval routes_IFACE=( \"\$\{routes_$iface\[@\]\}\" )

        eval inet6_IFACE=( \"\$\{inet6_$iface\[@\]\}\" )

        eval ifconfig_fallback_IFACE=( \"\$\{ifconfig_fallback_$iface\[@\]\}\" )

        # BACKWARD COMPATIBILITY: populate the ifconfig_IFACE array

        # if iface_IFACE is set (fex. iface_eth0 instead of ifconfig_eth0)

        eval local iface_IFACE=\"\$\{iface_$iface\}\"

        if [[ -n ${iface_IFACE} && -z ${ifconfig_IFACE} ]]; then

                # Make sure these get evaluated as arrays

                local -a aliases broadcasts netmasks

                # Start with the primary interface

                ifconfig_IFACE=( "${iface_IFACE}" )

                # ..then add aliases

                eval aliases=( \$\{alias_$iface\} )

                eval broadcasts=( \$\{broadcast_$iface\} )

                eval netmasks=( \$\{netmask_$iface\} )

                for ((i = 0; i < ${#aliases[@]}; i = i + 1)); do

                        ifconfig_IFACE[i+1]="${aliases[i]} ${broadcasts[i]:+broadcast ${broadcasts[i]}} ${netmasks[i]:+netmask ${netmasks[i]}}"

                done

        fi

        # BACKWARD COMPATIBILITY: check for space-separated inet6 addresses

        if [[ ${#inet6_IFACE[@]} == 1 && ${inet6_IFACE} == *' '* ]]; then

                inet6_IFACE=( ${inet6_IFACE} )

        fi

}

iface_start() {

        local IFACE=${1} i x retval

        checkconfig || return 1

        if [[ ${ifconfig_IFACE} != dhcp ]]; then

                # Show the address, but catch if this interface will be inet6 only

                i=${ifconfig_IFACE%% *}

                if [[ ${i} == *.*.*.* ]]; then

                        ebegin "Bringing ${IFACE} up (${i})"

                else

                        ebegin "Bringing ${IFACE} up"

                fi

                # ifconfig does not always return failure ..

                ifconfig ${IFACE} ${ifconfig_IFACE} >${devnull} && \

                ifconfig ${IFACE} up &>${devnull}

                eend $? || return $?

        else

                # Check that eth0 was not brought up by the kernel ...

                if [[ ${status_IFACE} == up ]]; then

                        einfo "Keeping kernel configuration for ${IFACE}"

                else

                        ebegin "Bringing ${IFACE} up via DHCP"

                        /sbin/dhcpcd ${dhcpcd_IFACE} ${IFACE}

                        retval=$?

                        eend $retval

                        if [[ $retval == 0 ]]; then

                                # DHCP succeeded, show address retrieved

                                i=$(ifconfig ${IFACE} | grep -m1 -o 'inet addr:[^ ]*' |

                                        cut -d: -f2)

                                [[ -n ${i} ]] && einfo "  ${IFACE} received address ${i}"

                        elif [[ -n "${ifconfig_fallback_IFACE}" ]]; then

                                # DHCP failed, try fallback.

                                # Show the address, but catch if this interfacewill be inet6 only

                                i=${ifconfig_fallback_IFACE%% *}

                                if [[ ${i} == *.*.*.* ]]; then

                                        ebegin "Using fallback configuration (${i}) for ${IFACE}"

                                else

                                        ebegin "Using fallback configuration for ${IFACE}"

                                fi

                                ifconfig ${IFACE} ${ifconfig_fallback_IFACE} >${devnull} && \

                                ifconfig ${IFACE} up &>${devnull}

                                eend $? || return $?

                        else

                                return $retval

                        fi

                fi

        fi

        if [[ ${#ifconfig_IFACE[@]} -gt 1 ]]; then

                einfo "  Adding aliases"

                for ((i = 1; i < ${#ifconfig_IFACE[@]}; i = i + 1)); do

                        ebegin "    ${IFACE}:${i} (${ifconfig_IFACE[i]%% *})"

                        ifconfig ${IFACE}:${i} ${ifconfig_IFACE[i]}

                        eend $?

                done

        fi

        if [[ -n ${inet6_IFACE} ]]; then

                einfo "  Adding inet6 addresses"

                for ((i = 0; i < ${#inet6_IFACE[@]}; i = i + 1)); do

                        ebegin "    ${IFACE} inet6 add ${inet6_IFACE[i]}"

                        ifconfig ${IFACE} inet6 add ${inet6_IFACE[i]} >${devnull}

                        eend $?

                done

        fi

        # Set static routes

        if [[ -n ${routes_IFACE} ]]; then

                einfo "  Adding routes"

                for ((i = 0; i < ${#routes_IFACE[@]}; i = i + 1)); do

                        ebegin "    ${routes_IFACE[i]}"

                        /sbin/route add ${routes_IFACE[i]}

                        eend $?

                done

        fi

        # Set default route if applicable to this interface

        if [[ ${gateway} == ${IFACE}/* ]]; then

                local ogw=$(/bin/netstat -rn | awk '$1 == "0.0.0.0" {print $2}')

                local gw=${gateway#*/}

                if [[ ${ogw} != ${gw} ]]; then

                        ebegin "  Setting default gateway ($gw)"

                        # First delete any existing route if it was setup by kernel...

                        /sbin/route del default dev ${IFACE} &>${devnull}

                        # Second delete old gateway if it was set...

                        /sbin/route del default gw ${ogw} &>${devnull}

                        # Third add our new default gateway

                        /sbin/route add default gw ${gw} >${devnull}

                        eend $? || {

                                true # need to have some command in here

                                # Note: This originally called stop, which is obviously

                                # wrong since it's calling with a local versionof IFACE.

                                # The below code works correctly to abort configuration of

                                # the interface, but is commented because we'reassuming

                                # that default route failure should not cause the interface

                                # to be unconfigured.

                                #local error=$?

                                #ewarn "Aborting configuration of ${IFACE}"

                                #iface_stop ${IFACE}

                                #return ${error}

                        }

                fi

        fi

        # Enabling rp_filter causes wacky packets to be auto-dropped by

        # the kernel.  Note that we only do this if it is not set via

        # /etc/sysctl.conf ...

        if [[ -e /proc/sys/net/ipv4/conf/${IFACE}/rp_filter && \

                        -z "$(grep -s '^[^#]*rp_filter' /etc/sysctl.conf)" ]]; then

                echo -n 1 > /proc/sys/net/ipv4/conf/${IFACE}/rp_filter

        fi

}

# iface_stop: bring down an interface.  Don't trust information in

# /etc/conf.d/net since the configuration might have changed since

# iface_start ran.  Instead query for current configuration and bring

# down the interface.

iface_stop() {

        local IFACE=${1} i x aliases inet6 count

        # Try to do a simple down (no aliases, no inet6, no dhcp)

        aliases="$(ifconfig | grep -o "^$IFACE:[0-9]*" | tac)"

        inet6="$(ifconfig ${IFACE} | awk '$1 == "inet6" {print $2}')"

        if [[ -z ${aliases} && -z ${inet6} && ! -e /var/run/dhcpcd-${IFACE}.pid]]; then

                ebegin "Bringing ${IFACE} down"

                ifconfig ${IFACE} down &>/dev/null

                eend 0

                return 0

        fi

        einfo "Bringing ${IFACE} down"

        # Stop aliases before primary interface.

        # Note this must be done in reverse order, since ifconfig eth0:1

        # will remove eth0:2, etc.  It might be sufficient to simply remove

        # the base interface but we're being safe here.

        for i in ${aliases} ${IFACE}; do

                # Delete all the inet6 addresses for this interface

                inet6="$(ifconfig ${i} | awk '$1 == "inet6" {print $3}')"

                if [[ -n ${inet6} ]]; then

                        einfo "  Removing inet6 addresses"

                        for x in ${inet6}; do

                                ebegin "    ${IFACE} inet6 del ${x}"

                                ifconfig ${i} inet6 del ${x}

                                eend $?

                        done

                fi

                # Stop DHCP (should be N/A for aliases)

                # Don't trust current configuration... investigate ourselves

                if /sbin/dhcpcd -z ${i} &>${devnull}; then

                        ebegin "  Releasing DHCP lease for ${IFACE}"

                        for ((count = 0; count < 9; count = count + 1)); do

                                /sbin/dhcpcd -z ${i} &>${devnull} || break

                                sleep 1

                        done

                        [[ ${count} -lt 9 ]]

                        eend $? "Timed out"

                fi

                ebegin "  Stopping ${i}"

                ifconfig ${i} down &>${devnull}

                eend 0

        done

        return 0

}

start() {

        # These variables are set by setup_vars

        local status_IFACE vlans_IFACE dhcpcd_IFACE

        local -a ifconfig_IFACE routes_IFACE inet6_IFACE

        # Call user-defined preup function if it exists

        if [[ $(type -t preup) == function ]]; then

                einfo "Running preup function"

                preup ${IFACE} || {

                        eerror "preup ${IFACE} failed"

                        return 1

                }

        fi

        # Start the primary interface and aliases

        setup_vars ${IFACE}

        iface_start ${IFACE} || return 1

        # Start vlans

        local vlan

        for vlan in ${vlans_IFACE}; do

                /sbin/vconfig add ${IFACE} ${vlan} >${devnull}

                setup_vars ${IFACE}.${vlan}

                iface_start ${IFACE}.${vlan}

        done

        # Call user-defined postup function if it exists

        if [[ $(type -t postup) == function ]]; then

                einfo "Running postup function"

                postup ${IFACE}

        fi

}

stop() {

        # Call user-defined predown function if it exists

        if [[ $(type -t predown) == function ]]; then

                einfo "Running predown function"

                predown ${IFACE}

        fi

        # Don't depend on setup_vars since configuration might have changed.

        # Investigate current configuration instead.

        local vlan

        for vlan in $(ifconfig | grep -o "^${IFACE}\.[^ ]*"); do

                iface_stop ${vlan}

                /sbin/vconfig rem ${vlan} >${devnull}

        done

        iface_stop ${IFACE} || return 1  # always succeeds, btw

        # Call user-defined postdown function if it exists

        if [[ $(type -t postdown) == function ]]; then

                einfo "Running postdown function"

                postdown ${IFACE}

        fi

}

# vim:ts=4

```

Can you post you /etc/conf.d/net and wireless files so I can check mine against yours? Also, what should my /etc/init.d/net.eth1 look like? I followed the instructions in setting up eth0 eth1 in the gentoo handbook, but since eth1 is wifi, do I need to get a different script?

----------

## jakubc

Ahaaa,

I think (hope) I see the answer... what verstion of baselayout do you have? you need the masked (~x86) version for wireless to work... I have version 1.11.11-r3...

I hope I'm right, I don't really know the ins and outs of baselayout, but I think that you are able to connect to your neighbour, because there is no setup of the card necesary i.e. the card is just told to connect like any normal ethernet card and it connects to the only thing it can connect to (someone please correct me if I'm wrong...)... and by telling the card your settings in in your script thru "iwconfig" you are then able to start it up using this pre-wireless aware version of baselayout (I really hope I have it right:-) ) 

This is my /etc/init.d/net.ra0:

```

#!/sbin/runscript

# Copyright (c) 2004-2005 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: /var/cvsroot/gentoo-src/rc-scripts/net-scripts/init.d/net.lo,v 1.38.2.17 2005/03/08 16:07:30 uberlord Exp $

# Contributed by Roy Marples (uberlord@gentoo.org)

# Many thanks to Aron Griffis (agriffis@gentoo.org)

# for help, ideas and patches

#NB: Config is in /etc/conf.d/net

if [[ -n ${NET_DEBUG} ]]; then

   set -x

   devnull=/dev/stderr

else

   devnull=/dev/null

fi

# For pcmcia users. note that pcmcia must be added to the same

# runlevel as the net.* script that needs it.

depend() {

   use coldplug hotplug pcmcia usb isdn4linux wlan

   # Load any custom depend functions for the given interface

   # For example, br0 may need eth0 and eth1

   local iface=${myservice##*.}

   [[ $( type -t depend_${iface} ) == "function" ]] && depend_${iface}

}

# Define where our modules are

MODULES_DIR=/lib/rcscripts/net.modules.d

# Load some functions shared between ourselves and our dhcp helpers

source ${MODULES_DIR}/helpers.d/functions

# Make some wrappers to fudge after/before/need/use depend flags.

# These are callbacks so mods[i] will be set.

after() {

   local x="$*"

   [[ $# -gt 1 ]] && x=$( echo -e "${x// /\n}" | sort | xargs )

   eval "${MODULE}_after() { echo \"$x\"; }"

}

before() {

   local x="$*"

   [[ $# -gt 1 ]] && x=$( echo -e "${x// /\n}" | sort | xargs )

   eval "${MODULE}_before() { echo \"$x\"; }"

}

need() {

   local x="$*"

   [[ $# -gt 1 ]] && x=$( echo -e "${x// /\n}" | sort | xargs )

   eval "${MODULE}_need() { echo \"$x\"; }"

}

installed() {

   local x="$*"

   [[ $# -gt 1 ]] && x=$( echo -e "${x// /\n}" | sort | xargs )

   # We deliberately misspell this as _installed will probably be used

   # at some point

   eval "${MODULE}_instlled() { echo \"$x\"; }"

}

sort() {

   LC_ALL=C /bin/sort "$@"

}

# void module_class_wrap(char *module, char *provides)

# Setup class wrappers: interface_up -> iproute2_up, for example

module_class_wrap() {

   local module=${1} provides=${2} x 

   # Don't wrap functions if another module already has

   [[ $( type -t ${provides}_provides ) == function ]] && return

   for x in $( typeset -f | grep -o ^${module}_'[^ ]*' ); do

      eval "${provides}${x#${module}}() { ${x} \"\$@\"; }"

   done

}

# bool module_load_minimum(char *module)

#

# Does the minimum checking on a module - even when forcing

module_load_minimum() {

   local f=${1} MODULE=${1##*/}

   if [[ ! -f ${f} ]]; then

      eerror "${f} does not exist"

      return 1

   fi

   if ! source ${f} ; then

      eerror "${MODULE} failed a sanity check"

      return 1

   fi

   for f in check_installed provides check_depends depend; do

      [[ $( type -t ${MODULE}_${f} ) == function ]] && continue

      eerror "${MODULE} does not support the required function ${f}"

      return 1

   done

   # Wrap our before/after/need/use functions

   ${MODULE}_depend

   return 0

}

# bool modules_load_auto()

#

# Load and check each module for sanity

# If the module is not installed, the functions are to be removed

modules_load_auto() {

   local e f i j beforefuncs afterfuncs diffs unload

   # Populate the MODULES array

   MODULES=( $( find ${MODULES_DIR}/ -maxdepth 1 -type f ! -name ".*" | sort ) )

   # Each of these sources into the global namespace, so it's

   # important that module functions and variables are prefixed with

   # the module name, for example iproute2_

   beforefuncs="$( typeset -F )"

   j=${#MODULES[@]}

   loaded_interface=false

   for (( i=0; i<j; i++ )); do

      unload=false

      module_load_minimum ${MODULES[i]} || unload=true

      MODULES[i]=${MODULES[i]##*/}

      ! ${unload} && ${MODULES[i]}_check_installed false || unload=true

      if [[ ${MODULES[i]} == interface ]]; then

         eerror "interface is a reserved name - cannot load a module called interface"

         return 1

      fi

      afterfuncs="$( typeset -F )"

      if ${unload} ; then

         unset MODULES[i]

         unsetfuncs="${unsetfuncs} $( diff -U0 <( echo "${beforefuncs}" ) <( echo "${afterfuncs}" ) 2>/dev/null \

            | awk 'BEGIN { ORS = " "; } /+declare -f/ { print $3; }' )"

      fi

      beforefuncs="${afterfuncs}"

   done

   MODULES=( "${MODULES[@]}" )

   return 0

}

# bool modules_check_installed(void)

#

# Ensure that all modules have the required modules loaded

# This enables us to remove modules from the MODULES array

# Whilst other modules can still explicitly call them

# One example of this is essidnet which configures network

# settings for the specific ESSID connected to as the user

# may be using a daemon to configure wireless instead of our

# iwconfig module

modules_check_installed() {

   local i j missingdeps nmods=${#MODULES[@]}

   for (( i=0; i<nmods; i++ )); do

      [[ $( type -t ${MODULES[i]}_instlled ) != function ]] && continue

      for j in $( ${MODULES[i]}_instlled ); do

         missingdeps=true

         if [[ $( type -t ${j}_check_installed ) == function ]]; then

            ${j}_check_installed && missingdeps=false

         fi

         ${missingdeps} && unset MODULES[i] && unset PROVIDES[i] && break

      done

   done

   MODULES=( "${MODULES[@]}" )

   PROVIDES=( "${PROVIDES[@]}" )

}

# bool modules_check_user(void)

modules_check_user() {

   local -a umods

   local i j k l npref nmods=${#MODULES[@]}

   # Has the interface got any specific modules?

   eval umods=( \"\$\{modules_${iface}\[@\]\}\" )

   # Global setting follows interface-specific setting

   umods=( "${umods[@]}" "${modules[@]}" )

   # Add our preferred modules

   npref=3

   umods=( "${umods[@]}" "ifconfig" "dhcpcd" "iwconfig" )

   # First we strip any modules that conflict from user settings

   # So if the user specifies pump then we don't use dhcpcd

   for (( i=0; i<${#umods[@]}; i++ )); do

      # Some users will inevitably put "dhcp" in their modules

      # list.  To keep users from screwing up their system this

      # way, ignore this setting so that the default dhcp

      # module will be used.

      [[ ${umods[i]} == dhcp ]] && continue

      # We remove any modules we explicitly don't want

      if [[ ${umods[i]} == !* ]]; then

         for (( j=0; j<nmods; j++ )); do

            [[ -z ${MODULES[j]} ]] && continue

            if [[ ${umods[i]:1} == ${MODULES[j]} || ${umods[i]:1} == ${PROVIDES[j]} ]]; then

               # We may need to setup a class wrapper for it even though

               # we don't use it directly

               ${MODULES[j]}_check_installed && module_class_wrap ${MODULES[j]}

               unset MODULES[j]

               unset PROVIDES[j]

               break

            fi

         done

         continue

      fi

      if [[ $( type -t ${umods[i]}_provides ) != function ]]; then

         # If the module is one of our preferred modules, then

         # ignore this error; whatever is available will be

         # used instead.

         (( i < ${#umods[@]} - npref )) || continue

         eerror "${umods[i]} is not a valid module (missing provides)"

         return 1

      fi

      # Ensure that the user specified module has its package installed

      if (( i < ${#umods[@]} - npref )); then

         # $1==true causes check_installed to report its own errors

         ${umods[i]}_check_installed true || return 1

      else

         # If this happens on a preferred modules, ignore it;

         # whatever is available will be used instead.

         ${umods[i]}_check_installed false || continue

      fi

      mod=$( ${umods[i]}_provides )

      for (( j=0; j<nmods; j++ )); do

         [[ -z ${MODULES[j]} ]] && continue

         if [[ ${PROVIDES[j]} == ${mod} && ${umods[i]} != ${MODULES[j]} ]]; then

            # We don't have a match - now ensure that we still provide an alternative.

            # This is to handle our preferred modules.

            for (( l=0; l<nmods; l++ )); do

               [[ ${l} -eq ${j} || -z ${MODULES[l]} ]] && continue

               if [[ ${PROVIDES[l]} == ${mod} ]]; then

                  unset MODULES[j]

                  unset PROVIDES[j]

                  break

               fi

            done

         fi

      done

   done

   # Then we strip conflicting modules.

   # We only need to do this for 3rd party modules that conflict with

   # our own modules and the preferred list AND the user modules

   # list doesn't specify a preference.

   for (( i=0; i<nmods-1; i++ )); do

      [[ -z ${MODULES[i]} ]] && continue         

      for (( j=i+1; j<nmods; j++)); do

         [[ -z ${MODULES[j]} ]] && continue

         [[ ${PROVIDES[i]} == ${PROVIDES[j]} ]] && unset MODULES[j] && unset PROVIDES[j]

      done

   done

   MODULES=( "${MODULES[@]}" )

   PROVIDES=( "${PROVIDES[@]}" )

   return 0

}

# void modules_sort(void)

modules_sort() {

   local -a modnums sort_history modafter modbefore

   local i j k p changed_something nmods=${#MODULES[@]}

   # Sort our modules

   # We do this by assigning numbers to each module

   # We also assign modbefore and modafter so we don't

   # shell out as much because it's expensive on CPU.

   modnums=()

   for (( i=0; i<nmods; i++ )); do

      modnums[i]=${i}

      [[ $( type -t ${MODULES[i]}_after ) == function ]] && modafter[i]=$( ${MODULES[i]}_after )

      [[ $( type -t ${MODULES[i]}_before ) == function ]] && modbefore[i]=$( ${MODULES[i]}_before )

   done

   

   # Then we swap numbers based on and after/before flags

   # until we don't swap anymore. The sort_history array prevents

   # the possibility of an infinite loop

   sort_history[0]="${modnums[*]}"

   for (( k=1; 1; k++ )); do

      changed_something=false

      for (( i=0; i<nmods; i++ )); do

         for p in ${modafter[i]}; do

            for (( j=0; j<nmods; j++ )); do

               [[ ${p} != ${MODULES[j]} && ${p} != ${PROVIDES[j]} ]] && continue

               if [[ ${modnums[i]} -lt ${modnums[j]} ]]; then

                  tmp=${modnums[i]}

                  modnums[i]=${modnums[j]}

                  modnums[j]=${tmp}

                  changed_something=true

               fi

            done

         done

         for p in ${modbefore[i]}; do

            for (( j=0; j<nmods; j++ )); do

               [[ ${p} != ${MODULES[j]} && ${p} != ${PROVIDES[j]} ]] && continue

               if [[ ${modnums[i]} -gt ${modnums[j]} ]]; then

                  tmp=${modnums[i]}

                  modnums[i]=${modnums[j]}

                  modnums[j]=${tmp}

                  changed_something=true

               fi

            done

         done

      done

      ${changed_something} || break

      # Make sure we aren't repeating a previous state

      # First time through, k=1, k/2=0

      sort_history[k]="${modnums[*]}"

      if [[ ${sort_history[k]} == ${sort_history[k/2]} ]]; then

         eerror "Detected an infinite loop sorting modules; blundering ahead"

         break

      fi

   done

   # Finally we sort our modules in number order

   um=""

   for (( i=0; i<nmods; i++ )); do

      um="${um}${modnums[i]} ${MODULES[i]} ${PROVIDES[i]}\n"

   done

   p=( $( echo -e "${um}" | sort -n | awk '{print $2,$3}' ) )

   MODULES=()

   PROVIDES=()

   j=0

   for (( i=0; i<${#p[@]}; i+=2 )); do

      MODULES[j]=${p[i]}

      PROVIDES[j]=${p[i+1]}

      (( j++ ))

   done

}

# bool modules_check_depends(bool showprovides)

modules_check_depends() {

   local showprovides=${1:-false} nmods=${#MODULES[@]} i j needmod

   local missingdeps p  interface=false

   for (( i=0; i<nmods; i++ )); do

      if [[ $( type -t ${MODULES[i]}_need ) == function ]]; then

         for needmod in $( ${MODULES[i]}_need ); do

            missingdeps=true

            for (( j=0; j<nmods; j++ )); do

               if [[ ${needmod} == ${MODULES[j]} || ${needmod} == ${PROVIDES[j]} ]]; then

                  missingdeps=false

                  break

               fi

            done

            if ${missingdeps} ; then

               eerror "${MODULES[i]} needs ${needmod} (dependency failure)"

               return 1

            fi

         done

      fi

      ${MODULES[i]}_check_depends || return 1

      [[ ${PROVIDES[i]} == interface ]] && interface=true

      if ${showprovides} ; then

         [[ ${PROVIDES[i]} != ${MODULES[i]} ]] && veinfo "${MODULES[i]} provides ${PROVIDES[i]}"

      fi

   done

   if ! ${interface} ; then

      eerror "no interface module has been loaded"

      return 1

   fi

   return 0

}

# bool modules_load(char *iface, bool starting)

#

# Loads the defined handler and modules for the interface

# Returns 0 on success, otherwise 1

modules_load()  {

   local iface=${1} starting=${2:-true} mod p=false i j unsetfuncs

   local -a x

   local RC_INDENTATION=${RC_INDENTATION}   # so it will reset after function

   local -a PROVIDES

   if [[ ${iface} == lo ]]; then

      # We force lo to only use these modules for a major speed boost

      modules_force=( "iproute2" "ifconfig" )

   else

      eval x=( \"\$\{modules_force_${iface}\[@\]\}\" )

      [[ -n ${x} ]] && modules_force=( "${x[@]}" )

      if [[ -n ${modules_force} ]]; then

         ewarn "WARNING: You are forcing modules!"

         ewarn "Do not complain or file bugs if things start breaking"

         report=true

      fi

      veinfo "Loading networking modules for ${iface}"

   fi

   eindent

   if [[ -z ${modules_force} ]]; then

      modules_load_auto || return 1

   else

      j=${#modules_force[@]}

      for (( i=0; i<j; i++ )); do

         module_load_minimum "${MODULES_DIR}/${modules_force[i]}" || return 1

         ${modules_force[i]}_check_installed || unset modules_force[i]

      done

      MODULES=( "${modules_force[@]}" )

   fi

   # We now buffer the _provides functions for a big speed boost

   j=${#MODULES[@]}

   for (( i=0; i<j; i++ )); do

      PROVIDES[i]=$( ${MODULES[i]}_provides )

   done

   if [[ -z ${modules_force[@]} ]]; then

      if ${starting}; then

         modules_check_user || return 1

      fi

      # We unset unloaded module functions here as so we can error

      # with a message informing the user to emerge the correct

      # package if it's in their modules

      [[ -n ${unsetfuncs} ]] && unset ${unsetfuncs}

      modules_sort

   fi

   # Setup class wrappers: interface_up -> iproute2_up, for example

   j=${#MODULES[@]}

   for (( i=0; i<j; i++ )); do

      module_class_wrap ${MODULES[i]} ${PROVIDES[i]}

   done

   modules_check_installed || return 1

   [[ ${iface} != lo ]] && veinfo "modules: ${MODULES[@]}"

   eindent

   [[ ${iface} != lo && ${starting} == true ]] && p=true

   modules_check_depends ${p} || return 1

   return 0

}

# bool iface_start(char *interface)

#

# iface_start is called from start.  It's expected to start the base

# interface (for example "eth0"), aliases (for example "eth0:1") and to start

# VLAN interfaces (for example eth0.0, eth0.1).  VLAN setup is accomplished by

# calling itself recursively.

iface_start() {

   local iface=${1} mod config_counter=-1 x warn=false config_worked=false

   local RC_INDENTATION=${RC_INDENTATION}   # so it will reset after function

   local -a config fallback fallback_route conf

   local ifvar=$( interface_variable ${iface} )

   # pre Start any modules with

   for mod in ${MODULES[@]}; do

      if [[ $( type -t ${mod}_pre_start ) == function ]]; then

         ${mod}_pre_start ${iface} || { eend 1; return 1; }

      fi

   done

   # New style config - one variable fits all

   eval config=( \"\$\{config_${ifvar}\[@\]\}\" )

   eval fallback=( \"\$\{fallback_${ifvar}\[@\]\}\" )

   eval fallback_route=( \"\$\{fallback_route_${ifvar}\[@\]\}\" )

   # We must support old configs

   if [[ -z ${config} ]]; then

      interface_get_old_config ${iface} || return 1

   fi

   # Handle "noop" correctly

   if [[ ${config[0]} == "noop" ]]; then

      if interface_is_up ${iface} true ; then

         einfo "Keeping current configuration for ${iface}"

         eend 0

         return 0

      fi

      # Remove noop from the config var

      config=( "${config[@]:1}" )

   fi

   # Provide a default of DHCP if no configuration is set

   if [[ -z ${config} ]]; then

      if [[ $( type -t dhcp_start ) == function ]]; then

         config=( "dhcp" )

         warn=true

      else

         eerror "Cannot default to dhcp as there is no dhcp module loaded"

         eerror "No configuration for ${iface}"

         return 1

      fi

   fi

   einfo "Bringing up ${iface}"

   eindent

   for (( config_counter=0; config_counter<${#config[@]}; config_counter++ )); do

      # Handle null and noop correctly

      if [[ ${config[config_counter]} == "null" \

      || ${config[config_counter]} == "noop" ]]; then

         eend 0

         config_worked=true

         continue

      fi

      if ${warn}; then

         ewarn "Configuration not set for ${iface} - assuming dhcp"

         warn=false

      fi

      # We convert it to an array - this has the added

      # bonus of trimming spaces!

      conf=( ${config[config_counter]} )

      einfo "${conf[0]}"

      # Do we have a function for our config?

      if [[ $( type -t ${conf[0]}_start ) == function ]]; then

         # Check that the module is valid

         x=false

         for mod in ${MODULES[@]}; do

            if [[ $( ${mod}_provides ) == ${conf[0]} ]]; then

               x=true

               break

            fi

         done

         if ! ${x}; then

            [[ $( type -t ${conf[0]}_check_installed == function ) ]] && ${conf[0]}_check_installed true

            eerror "No loaded modules provide \"${conf[0]}\" (${conf[0]}_start)"

         else

            eindent

            ${conf[0]}_start ${iface} ; x=$?

            eoutdent

            [[ ${x} == 0 ]] && config_worked=true && continue

         fi

      # We need to test to see if it's an IP address or a function

      # We do this by testing if the 1st character is a digit

      elif [[ ${conf[0]:0:1} == [[:digit:]] || ${conf[0]} == *:* ]]; then

         x=0

#         if [[ $(type -t address_exists ) == function ]]; then

#            if address_exists ${iface} ${conf[0]} ; then

#               eerror "${conf[0]%%/*} already taken on ${iface}"

#               x=1

#            fi

#         fi

         [[ ${x} == 0 ]] && interface_add_address ${iface} ${conf[@]} ; x=$?

         eend ${x} && config_worked=true && continue

      else

         eerror "No loaded modules provide \"${conf[0]}\" (${conf[0]}_start)"

      fi

      if [[ -n ${fallback[config_counter]} ]]; then

         einfo "Trying fallback configuration"

         config[config_counter]=${fallback[config_counter]}

         fallback[config_counter]=''

         # Do we have a fallback route?

         if [[ -n ${fallback_route[config_counter]} ]]; then

            eval "routes_${ifvar}=( "\"\$\{fallback_route\[${config_counter}\]\[@\]\}\"" )"

            fallback_route[config_counter]=''

         fi

         (( config_counter-- )) # since the loop will increment it

         continue

      fi

   done

   eoutdent

   # We return failure if no configuration parameters worked

   ${config_worked} || return 1

   # Start any modules with _post_start

   for mod in ${MODULES[@]}; do

      if [[ function == $( type -t ${mod}_post_start ) ]]; then

         ${mod}_post_start ${iface} || return 1

      fi

   done

   return 0

}

# bool iface_stop(char *interface)

#

# iface_stop: bring down an interface.  Don't trust information in

# /etc/conf.d/net since the configuration might have changed since

# iface_start ran.  Instead query for current configuration and bring

# down the interface.

#

# However, we are currently reliant on handler and modules specified

# in /etc/conf.d/net

iface_stop() {

   local iface=${1} i aliases need_begin=false mod

   local RC_INDENTATION=${RC_INDENTATION}   # so it will reset after function

   # pre Stop any modules

   for mod in ${MODULES[@]}; do

      [[ $( type -t ${mod}_pre_stop ) == function ]] && ${mod}_pre_stop ${iface}

   done

   einfo "Bringing down ${iface}"

   eindent

   # Collect list of aliases for this interface.

   # List will be in reverse order.

   aliases=$( interface_get_aliases_rev ${iface} )

   # Stop aliases before primary interface.

   # Note this must be done in reverse order, since ifconfig eth0:1 

   # will remove eth0:2, etc.  It might be sufficient to simply remove 

   # the base interface but we're being safe here.

   for i in ${aliases} ${iface}; do

      # Stop all our modules

      for mod in ${MODULES[@]}; do

         [[ $( type -t ${mod}_stop ) == function ]] && ${mod}_stop ${i}

      done

      # A module may have removed the interface

      interface_exists ${iface} || { eend 0; continue; }

      # Delete all the addresses for this alias

      interface_del_addresses ${i}

      # Do final shut down of this alias

      ebegin "Shutting down ${i}"

      interface_iface_stop ${i}

      eend $?

   done

   # post Stop any modules

   for mod in ${MODULES[@]}; do

      # We have already taken down the interface, so no need to error

      [[ $( type -t ${mod}_post_stop ) == function ]] && ${mod}_post_stop ${iface}

   done

   return 0

}

# bool run_start(char *iface)

#

# Brings up ${IFACE}.  Calls preup, iface_start, then postup.

# Returns 0 (success) unless preup or iface_start returns 1 (failure).

# Ignores the return value from postup.

# We cannot check that the device exists ourselves as modules like

# tuntap make create it.

run_start() {

   local iface=${1} ifvar x

   if [[ ${iface} == lo ]]; then

      ebegin "Bringing up ${iface}"

      interface_loopback_create

      eend $?

      return $?

   fi

   # We may not have a loaded module for ${iface}

   # Some users may have "alias natsemi eth0" in /etc/modules.d/foo

   # so we can work with this

   # However, if they do the same with eth1 and try to start it

   # but eth0 has not been loaded then the module gets loaded as

   # eth0.

   # Not much we can do about this :(

   # Also, we cannot error here as some modules - such as bridge

   # create interfaces

   if ! interface_exists ${iface} ; then

      /sbin/modprobe ${iface} &>/dev/null

   fi

   # Setup variables for pre/post to use

   ifvar=$( interface_variable ${iface} )

   local IFACE=${iface} IFVAR=${ifvar}

   # Call user-defined preup function if it exists

   if [[ $( type -t preup ) == function ]]; then

      einfo "Running preup function"

      eindent

      preup ${iface} ; x=$?

      eoutdent

      if [[ ${x} != 0 ]]; then

         eerror "preup ${iface} failed"

         return 1

      fi

   fi

   # Don't let preup modify us

   iface=${1}

   local IFACE=${iface} IFVAR=${ifvar} config

   # If config is set to noop and the interface is up with an address

   # then we don't start it

   eval config=( \"\$\{config_${ifvar}\[@\]\}\" )

   if [[ ${config[0]} == "noop" ]] && interface_is_up ${iface} true ; then

      einfo "Keeping current configuration for ${iface}"

      eend 0

   else

      # Remove noop from the config var

      [[ ${config[0]} == "noop" ]] && eval "config_${ifvar}=( "\"\$\{config\[@\]:1\}\"" )"

      # There may be existing ip address info - so we strip it

      interface_del_addresses ${iface}

      # Start the interface

      if ! iface_start ${iface} ; then

         interface_down ${iface}

         eend 1

         return 1

      fi

   fi

   # Call user-defined postup function if it exists

   if [[ $( type -t postup ) == function ]]; then

      einfo "Running postup function"

      eindent

      postup ${iface}

      eoutdent

   fi

   return 0

}

# bool run_stop(char *iface) {

#

# Brings down ${iface}.  If predown call returns non-zero, then

# stop returns non-zero to indicate failure bringing down device.

# In all other cases stop returns 0 to indicate success.

run_stop() {

   local iface=${1} ifvar x

   # Don't run any special shutdown functions for lo

   if [[ ${iface} == lo ]]; then

      ebegin "Shutting down ${iface}"

      interface_iface_stop ${iface}

      eend $?

      return 0

   fi

   # Setup variables for pre/post to use

   ifvar=$( interface_variable ${iface} )

   local IFACE=${iface} IFVAR=${ifvar}

   # Call user-defined predown function if it exists

   if [[ $( type -t predown ) == function ]]; then

      einfo "Running predown function"

      eindent

      predown ${iface} ; x=$?

      eoutdent

      if [[ ${x} != 0 ]]; then

         eend 1 "predown ${iface} failed"

         return 1

      fi

   elif is_net_fs /; then

      eerror "root filesystem is network mounted -- can't stop ${iface}"

      return 1

   fi

   # Don't let predown modify us

   iface=${1}

   local IFACE=${iface} IFVAR=${ifvar}

   iface_stop ${iface} || return 1  # always succeeds, btw

   # Call user-defined postdown function if it exists

   if [[ $( type -t postdown ) == function ]]; then

      einfo "Running postdown function"

      eindent

      postdown ${iface}

      eoutdent

   fi

   return 0

}

# bool run(char *iface, char *cmd)

#

# Main start/stop entry point

# We load modules here and remove any functions that they

# added as we may be called inside the same shell scope for another interface

run() {

   local iface=${1} cmd=${2} r=1 RC_INDENTATION=${RC_INDENTATION}   # so it will reset after function

   local before starting=true

   local -a MODULES mods

   eindent

   unset_functions=${unset_functions:-false}

   ${unset_functions} && before="$( typeset -F )"

   [[ ${cmd} == "stop" ]] && starting=false

   if modules_load ${iface} ${starting} ; then

      if [[ ${cmd} == "stop" ]]; then

         # Reverse the module list for stopping

         mods=( "${MODULES[@]}" )

         for ((i = 0; i < ${#mods[@]}; i++)); do

            MODULES[i]=${mods[((${#mods[@]} - i - 1))]}

         done

         run_stop ${iface} && r=0

      else

         run_start ${iface} && r=0

      fi

   fi

   # We need to remove added functions before we quit as other init

   # scripts may be launching afterwards

   ${unset_functions} && \

   unset $( diff -U0 <( echo "${before}" ) <( echo "$( typeset -F )" ) 2>/dev/null \

      | awk 'BEGIN { ORS = " "; } /+declare -f/ { print $3; }' ) 2>/dev/null

   return ${r}

}

# bool start(void)

#

# Start entry point so that we only have one function

# which localises variables and unsets functions

start() {

   einfo "Starting ${IFACE}"

   run ${IFACE} start

   return $?

}

# bool stop(void)

#

# Stop entry point so that we only have one function

# which localises variables and unsets functions

stop() {

   einfo "Stopping ${IFACE}"

   run ${IFACE} stop

   return $?

}

# bool restart(void)

#

# Restart entry point

# We do this so as we only have to remove functions when stopping

restart() {

   local unset_functions=true

   service_started "${myservice}" && svc_stop

   unset_functions=false

   svc_start

   return $?

}

# vim:ts=4

```

As for the ifconfig_eth0 and iface_eth0 they mean the same thing (again someone please correct me if I'm wrong...)... according to what is found in /etc/init.d/net.lo:

```

#       ifconfig_IFACE                  (array of ifconfig lines, replaces iface_IFACE)

```

I am holding my breath^^...

----------

## TerranAce007

Well, I upgraded from baselayout 1.9.4-r7 to the ~amd64 baselayout 1.11.11-r3, and I still have the same problem, but now some of my init scripts don't work because they seem to have syntax errors.... My net.eth1 reported syntax errors after the upgrade, so I tried yours but it would even work...

----------

## jakubc

hi,

I've been searching the forums for your problem... and the solution I proposed was even given by the grand master guru of wireless baselayout UberLord himself:-) (https://forums.gentoo.org/viewtopic-t-289029, and https://forums.gentoo.org/viewtopic-t-280975).  Your net.eth1 should't have any syntax problems, since it's symlinked to net.lo (ln -s /etc/init.d/net.lo /etc/init.d/net.eth1) or should be anyway... check if you have if linked this way (I would recomend backing up your /etc/init.d/net.eth1 before symlinking, so that you can revert back to your previous setup without a problem in case this doesn't work either).

also you did unmask all the dependencies of baselayout (sysvinit, bash, readline, ) as well?

sorry for tha late reply... I was sleeping:-)

hope it works now!

----------

## TerranAce007

Okay, I have gotten it working. When I installed the new baselayout, I didn't run etc-update to put in the new wireless net.lo file. Once I did that, I am able to connect with WEP. I had messed with it some last night and was able to connect fine without WEP, but the new net.lo allows me to use WEP.

I am still trying to get it to work with essid broadcast turned off on the router. This is not a big deal, but I prefer not having my wireless router advertising itself even though it is encrypted. With broadcasting on, the script finds my router and connects right away. With it off, it finds the router as <hidden> rather than my essid "homenetwork," and attemps to connect to my neighbor's network instead. If I do a net.eth1 restart on the command line, I get the same thing until I run the iwconfig command, then it will find my hidden router. I saw something in wireless.example about using MAC adresses instead of essids for non-broadcasted essids, so I will try that...

EDIT: After assigning the MAC address in the wireless file, I am able to connect on startup without an essid broadcast from the router!

Thanks for your help!

----------

## jakubc

Wow, that's great! congratulations:-) I use WEP myselt, but will be moving on to WPA as soon as I finish my thesis... the reason being (among others) this thread https://forums.gentoo.org/viewtopic-t-330914.  The gist of it is that WEP keys, of any length can be cracked in a pretty hilarious amount of time...

Happy wifi-ing!

----------

