ref: f5270cc29ed8b3336d0623ad3458acac20692626
parent: 913a0d16bf8b82736a8f44b7b75324f3bb216629
author: Aaron Bieber <[email protected]>
date: Wed Nov 29 17:02:35 EST 2023
restructure
--- /dev/null
+++ b/rc/clear.rc
@@ -1,0 +1,4 @@
+#!/bin/rc
+
+if(test -f /mnt/wsys/text)
+ echo -n >/mnt/wsys/text
--- a/rc/drawlisten
+++ /dev/null
@@ -1,7 +1,0 @@
-#!/bin/rc
-rfork en
-pw=`{echo | awk 'BEGIN { srand() } END { print rand() }'}
-echo $pw
-echo 'key proto=dp9ik dom=cirno user='$user' !password='$pw >/mnt/factotum/ctl
-aux/listen1 -t 'tcp!*!rcpu' /rc/bin/service/tcp17019
-
--- /dev/null
+++ b/rc/drawlisten.rc
@@ -1,0 +1,7 @@
+#!/bin/rc
+rfork en
+pw=`{echo | awk 'BEGIN { srand() } END { print rand() }'}
+echo $pw
+echo 'key proto=dp9ik dom=cirno user='$user' !password='$pw >/mnt/factotum/ctl
+aux/listen1 -t 'tcp!*!rcpu' /rc/bin/service/tcp17019
+
--- a/rc/mkfile
+++ b/rc/mkfile
@@ -4,7 +4,9 @@
RC=\
drawlisten\
sysbuild\
- riostart
+ riostart\
+ clear\
+ whi
</sys/src/cmd/mkmany
@@ -14,5 +16,5 @@
mk $MKFLAGS $i.rcinstall
%.rcinstall:V:
- cp $stem $BIN/$stem
+ cp $stem.rc $BIN/$stem
chmod +x $BIN/$stem
--- a/rc/riostart
+++ /dev/null
@@ -1,10 +1,0 @@
-#!/bin/rc
-window 0,0,161,500 stats -lmisceb
-window 170,9,1357,758
-
-if(~ $machine 'imx8')
- reform/shortcuts </dev/kbdtap >/dev/kbdtap &
-
-window -hide auth/fgui
-
-~ $#console 0 || window -scroll console
--- /dev/null
+++ b/rc/riostart.rc
@@ -1,0 +1,10 @@
+#!/bin/rc
+window 0,0,161,500 stats -lmisceb
+window 170,9,1357,758
+
+if(~ $machine 'imx8')
+ reform/shortcuts </dev/kbdtap >/dev/kbdtap &
+
+window -hide auth/fgui
+
+~ $#console 0 || window -scroll console
--- a/rc/sysbuild
+++ /dev/null
@@ -1,55 +1,0 @@
-#!/bin/rc -b
-rfork en
-
-build_news=/lib/news/build
-
-if(test -e /mnt/wsys/wctl){
- echo scroll > /mnt/wsys/wctl
-}
-
-flagfmt='f:force';
-eval `''{aux/getflags $*} || exec aux/usage
-
-cd /
-if(! test -d .git)
- bind -ac /dist/plan9front /
-branch=`{git/branch}
-cid=`{cat /.git/refs/$branch}
-ver=unknown
-
-if(test -f $build_news)
- ver=`{cat $build_news}
-
-if(! ~ $force 1){
- if(~ $ver $cid){
- echo System up-to-date: $ver
- exit 0
- }
-}
-
-fn build{
- mk && mk install
-}
-
-cd /sys/src
-build
-
-machine=`{echo $terminal | awk -F/ '{print $5}'}
-switch($machine){
-case imx8
- cd /sys/src/9/imx8
- build
- if(! test -f /srv/ext4)
- ext4srv
- mount /srv/ext4 /n/emmc /dev/sdO0/linux
- cp /arm64/9reform.u /n/emmc/
-case pc64
- cd /sys/src/9/pc64
- build
- bind -a '#S' /dev
- 9fs 9fat
- cp /amd64/9pc64 /n/9fat/
-}
-
-echo $cid >$build_news
-echo Updated to $cid
--- /dev/null
+++ b/rc/whi.rc
@@ -1,0 +1,16 @@
+#!/bin/rc
+
+# TODO: make this dynamic
+knowns=`{awk '$0 ~ /essid/ {split($3, a, "="); print a[2]}' /mnt/factotum/ctl}
+ether=ether1
+if(~ $#* 1)
+ ether=$1
+
+#eval `{kill wpa}
+
+for(k in $knowns){
+ if(grep -s $k /net/$ether/ifstats){
+ echo '==>' found wireless: $k
+ aux/wpa -s $k /net/$ether
+ }
+}