code: plan9front

ref: 28f76455d39d990b47c6e46e18158f0a9ba09d25
dir: /rc/bin/aanuke/

View raw version
#!/bin/rc
rfork e
for(i in `{psu | awk '/[ ]+aan$/ {print $2}'}){
	if(! grep -s -e '[ ]+\/net(\.alt)?\/tcp\/[0-9]+\/data$' /proc/$i/fd)
		echo '@{echo kill>/proc/'$i'/note} # aan (idle)'
}