# [solved] >1 line of "config_eth0=..." in /etc/conf.d/net

## toralf

I'm wondering, whether it is possible to have something within that file like :

```

if [[ "$(cat /sys/class/net/eth0/carrier)" = "1" ]]; then

        config_eth0=( "192.168.0.254/16" "dhcp")

else

        config_eth0=( "192.168.0.254/16" )

fi
```

Last edited by toralf on Mon Jan 24, 2011 3:18 pm; edited 1 time in total

----------

## Voltago

openrc-0.7.0 knows

```
fallback_eth0="..."
```

Look into your openrc/baselayout documentation if your version supports it (it probably does).

----------

## toralf

Well - I'd like to avoid to wait for DHCP timeout, but anyway,  thx

----------

## Voltago

 *toralf wrote:*   

> Well - I'd like to avoid to wait for DHCP timeout, but anyway,  thx

 

Oh, I see. Then you should emerge ifplugd and add in /etc/conf.d/net

```
modules_eth0="plug"
```

and in rc.conf (that's for openrc, dunno if baselayout-1.x does it the same way)

```
rc_depend_strict="NO"
```

so that sshd and stuff can start before a physical network connection is up, and finally

```
rc-update del net.eth0
```

----------

## toralf

ok, thx

----------

