LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Network card connection state (https://www.linuxquestions.org/questions/slackware-14/network-card-connection-state-295955/)

eeades 02-28-2005 02:51 PM

Network card connection state
 
Does anyone know where the driver for the realtek cards would put the connection status of the cable? What I would like to do is modify the startup script so that DHCP is not trying to aquire an address if the cable is not hooked up. If I am using wireless, or in a location that I do not have/need network access, I do not want to wait for DHCP to decide that it won't get a response.

Thanks,

Eric

nonzero 02-28-2005 03:07 PM

We do not mess with startup scripts, we add and remove services or devices using the appropriate tools. i.e. ifconfig eth0 down etc. etc.....

nz

Matir 02-28-2005 03:14 PM

You should be able to use mii-tool to determine this. This SHOULD work:
Code:

if [ `/sbin/mii-tool eth0 | grep -ci 'link up'` -eq 0 ]
then echo "Link is down"
else echo "Link is up"
fi


eeades 02-28-2005 06:13 PM

Thank you very much

Eric


All times are GMT -5. The time now is 06:54 PM.