shithub: rc

ref: 93ba76d2649f29277de1e383d7469525364aaec8
dir: /bin/mw/

View raw version
#!/bin/rc
rfork n
if(! test -f $home/lib/mbox){
	echo $0: $home/lib/mbox doesn''t exist >[1=2]
	exit nope
}
wsz=`{read -c 48 /mnt/wsys/wctl}
awk -v 'x1='$wsz(1) -v 'x2='$wsz(3) -v 'y2='$wsz(4) '
BEGIN{
	xmax = x2 - x1
	ymax = y2
	x2 = xmax - 8
	y2 = ymax - 48
	x1 = 0
	y1 = 0
	print "#!/bin/rc"
}/^[^#]/{
	print "window -r", x1, y1, x2, y2, "mailrio", $1, $2
	y1 += 116
	x2 -= 4
}
END{
	x2 = xmax
	y2 = y1 + 116
	print "window -scroll -r", x1, y1, x2, y2, "tail -f /sys/log/smtp"
	y1 += 116
	y2 += 116
	print "window -scroll -r", x1, y1, x2, y2, "tail -f /sys/log/smtp.fail"
	y1 = ymax - 34
	y2 = ymax
	print "window -r", x1, y1, x2, y2, "winwatch"
}
' $home/lib/mbox >/tmp/mw.$pid
chmod +x /tmp/mw.$pid
bof -i /tmp/mw.$pid
rm /tmp/mw.$pid