Plan 9 from Bell Labs’s /usr/web/sources/plan9/sys/lib/dist/pc/inst/startether

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc

# desc: activate ethernet card
# prereq: configether

switch($1) {
case checkready
	if(isipdevup /net/ether0) {
		startether=done
		export startether
	}

case go
	if(isipdevup /net/ether0)
		exit

	log starting ethernet $ethermethod config
	switch($ethermethod) {
	case manual
		ip/ipconfig -g $gwaddr ether /net/ether0 $ipaddr $ipmask >>[2]/srv/log
	case dhcp
		ip/ipconfig $dhcphost -D >>/srv/log >[2=1]
	}

case checkdone
	if(! isipdevup /net/ether0) {
		startether=notdone
		export startether
	}
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].