summaryrefslogtreecommitdiff
path: root/sys/src/9/boot/net.rc
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-04-18 20:55:41 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2014-04-18 20:55:41 +0200
commit8d0e4cf37b25250c2cdb98afaab2b620f0934fac (patch)
tree3c129afbb466c30e04ca95f418c12068268eacd7 /sys/src/9/boot/net.rc
parentfc15a01d1de27cdd4ed8d8f863a0e46bafe9bd12 (diff)
wpa support for tcp boot, remove duplicate secstore code from factotum
to run aux/wpa at boot, we need factotum to be running. tho factotum was started only after the network was configured. what we do now is start factotum early, not fetching keys from secstore. once network is available and the auth server is known, we fetch keys from secstore using auth/secstore in bootrc. to pass the authserver for p9 authentication to factotum, we write it in /net/ndb and the special _authdial() in factotum will picks it up. as we are using auth/secstore binary in any case, we remove the duplicated secstore code from factotum and make it just exec auth/secstore to fetch the keys on startup (unless -n or -S is specified).
Diffstat (limited to 'sys/src/9/boot/net.rc')
-rwxr-xr-xsys/src/9/boot/net.rc19
1 files changed, 18 insertions, 1 deletions
diff --git a/sys/src/9/boot/net.rc b/sys/src/9/boot/net.rc
index 461564747..c048eda8d 100755
--- a/sys/src/9/boot/net.rc
+++ b/sys/src/9/boot/net.rc
@@ -1,6 +1,20 @@
#!/bin/rc
fn confignet{
+ # get primary default interface if not specified
+ if(~ $#* 0){
+ e=/net/ether*
+ if(! ~ $e '/net/ether*')
+ *=(ether $e(1))
+ }
+
+ # setup wifi encryption if any
+ if(~ $1 ether && ~ $service terminal && test -x /bin/aux/wpa){
+ if(grep -s '^status: need authentication' $2/ifstats){
+ aux/wpa -p $2
+ }
+ }
+
must ip/ipconfig -p $*
if(~ $#fs 0)
fs=`{awk -F'=' '/fs=/{print $2; exit}' /net/ndb}
@@ -8,8 +22,11 @@ fn confignet{
auth=`{awk -F'=' '/auth=/{print $2; exit}' /net/ndb}
if(~ $#fs 0)
ask fs ' ip is? ' $auth
- if(~ $#auth 0)
+ if(~ $#auth 0){
ask auth ' ip is? ' $fs
+ if(~ $#auth 1)
+ echo ' auth='^$auth >>/net/ndb
+ }
}
fn connecttcp{