/[gentoo]/xml/htdocs/doc/en/handbook/hb-net-functions.xml
Gentoo

Diff of /xml/htdocs/doc/en/handbook/hb-net-functions.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.9 Revision 1.10
2<!DOCTYPE sections SYSTEM "/dtd/book.dtd"> 2<!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3 3
4<!-- The content of this document is licensed under the CC-BY-SA license --> 4<!-- The content of this document is licensed under the CC-BY-SA license -->
5<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> 5<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6 6
7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-net-functions.xml,v 1.9 2006/10/28 09:17:55 neysx Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-net-functions.xml,v 1.10 2007/03/07 01:00:20 nightmorph Exp $ -->
8 8
9<sections> 9<sections>
10 10
11<abstract> 11<abstract>
12If you're feeling adventurous, you can add your own functions to networking. 12If you're feeling adventurous, you can add your own functions to networking.
13</abstract> 13</abstract>
14 14
15<version>7.0</version> 15<version>7.1</version>
16<date>2006-08-30</date> 16<date>2007-03-06</date>
17 17
18<section> 18<section>
19<title>Standard function hooks</title> 19<title>Standard function hooks</title>
20<body> 20<body>
21 21
43is <c>${IFACE}</c> converted to variable name bash allows. 43is <c>${IFACE}</c> converted to variable name bash allows.
44</p> 44</p>
45 45
46<pre caption="pre/post up/down function examples"> 46<pre caption="pre/post up/down function examples">
47preup() { 47preup() {
48 <comment># Test for link on the interface prior to bringing it up. This
49 # only works on some network adapters and requires the mii-diag
50 # package to be installed.</comment>
51 if mii-tool ${IFACE} 2> /dev/null | grep -q 'no link'; then
52 ewarn "No link on ${IFACE}, aborting configuration"
53 return 1
54 fi
55
56 <comment># Test for link on the interface prior to bringing it up. This 48 <comment># Test for link on the interface prior to bringing it up. This
57 # only works on some network adapters and requires the ethtool 49 # only works on some network adapters and requires the ethtool
58 # package to be installed.</comment> 50 # package to be installed.</comment>
59 if ethtool ${IFACE} | grep -q 'Link detected: no'; then 51 if ethtool ${IFACE} | grep -q 'Link detected: no'; then
60 ewarn "No link on ${IFACE}, aborting configuration" 52 ewarn "No link on ${IFACE}, aborting configuration"

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.20