changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: 9/boot/net.rc: suppress error from grep if ethernet ifstats file is not found

changeset 7483: 26b187835048
parent 7479: f4f9414878e1
child 7484: cc5c37116d5e
author: cinap_lenrek@felloff.net
date: Wed, 04 Dec 2019 21:56:13 +0100
files: sys/src/9/boot/net.rc
description: 9/boot/net.rc: suppress error from grep if ethernet ifstats file is not found

this can happen with nusb/ether, which does not implement ifstats file.
     1.1--- a/sys/src/9/boot/net.rc
     1.2+++ b/sys/src/9/boot/net.rc
     1.3@@ -10,7 +10,7 @@ fn confignet{
     1.4 
     1.5 	# setup wifi encryption if any
     1.6 	if(~ $1 ether && test -x /bin/aux/wpa){
     1.7-		essid=`{grep '^essid: ' $2/ifstats | sed 's/^essid: //; q'}
     1.8+		essid=`{grep '^essid: ' $2/ifstats >[2]/dev/null | sed 's/^essid: //; q'}
     1.9 		if(! ~ $#essid 0){
    1.10 			if(! ~ $#wpapsk 0 || grep -s '^status: need authentication' $2/ifstats >[2]/dev/null){
    1.11 				x=(aux/wpa -s $"essid)