Gentoo Archives: gentoo-laptop

From: Henrik Brix Andersen <brix@g.o>
To: gentoo-laptop@l.g.o
Subject: Re: [gentoo-laptop] Abort network startup when cable not connected
Date: Wed, 18 May 2005 09:30:00
Message-Id: 1116408602.5226.3.camel@sponge.fungus
In Reply to: [gentoo-laptop] Abort network startup when cable not connected by Zander Z365
1 On Tue, 2005-05-17 at 18:12 -0400, Zander Z365 wrote:
2 > How can I configure the startup script so that networking will not be
3 > started if the cable is not connected?
4
5 I have the following preup() function in my /etc/conf.d/net file:
6
7 preup() {
8 case ${IFACE} in
9 eth0)
10 ebegin "Checking link on ${IFACE}"
11 mii-tool ${IFACE} 2> /dev/null | grep -q 'link ok'
12 eend $?
13 ;;
14
15 *)
16 ;;
17 esac
18 }
19
20 Note: this is for use with baselayout-1.11.x.
21
22 Sincerely,
23 Brix
24 --
25 Henrik Brix Andersen <brix@g.o>
26 Gentoo Linux

Attachments

File name MIME type
signature.asc application/pgp-signature