xref: /plan9/sys/lib/dist/pc/inst/mainloop (revision 9a747e4fd48b9f4522c70c07e8f882a15030f964)
1#!/bin/rc
2
3sleep 86400 &
4cd /bin/inst
5. defs
6fn sigint { }
7
8coherence
9
10disks=`{ls /dev/sd*/data >[2]/dev/null | sed 's!/dev/(sd..)/data!\1!'}
11for (i in /dev/sd*/data)
12	if(test -f $i)
13		disk/fdisk -p $i>`{basename -d $i}^/ctl >[2]/dev/null
14for(i in /dev/sd*/plan9*)
15	if(test -f $i)
16		disk/prep -p $i >`{basename -d $i}^/ctl >[2]/dev/null
17
18# we run this while() here so that ctl-d won''t exit from us -- it''ll only exit main!
19# main contains a while() loop too, to avoid the hit of
20# continually reexecing from here.
21
22while()
23	main
24