Plan 9 from Bell Labs’s /usr/web/sources/contrib/sl/rc/hstats

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc
rfork e
read=/n/fs/usr/sl/www/werc/sites/read.stanleylieber.com
tumblr=/n/fs/usr/sl/www/werc/sites/tumblr.stanleylieber.com
msg=`{date | awk '{print $1 " " $2 " " $3 " " substr($4, 1, length($4)-3)}'}
msg=`{echo $"msg '|' `{w}}
#if(test -f /dev/cputemp && ! ~ $sysname hj* pi* rpi t42 t43p *x230 *x301)
#	msg=`{echo $"msg '| c'^`{cat /dev/cputemp | sed 's/±.//g'}}
if(test -d /mnt/apm/battery)
	msg=`{echo $"msg '| b'^`{sed 1q /mnt/apm/battery | awk '{print $2}'}}
if(test -d /mail/fs/mbox)
	msg=`{echo $"msg '| m'^`{ls /mail/fs/mbox | grep -v ctl | wc -l}}
if(test -d $read/src)
	rmsg=`{echo '| r'^`{ls -p $read/src | sort -n | tail -1}}
if(test -d $tumblr/src)
	tmsg=`{echo '| t'^`{ls -p $tumblr/src | sort -n | tail -1}}
echo $"msg `{if(! ~ $#rmsg 0){ echo $"rmsg }} `{if(! ~ $#tmsg 0){ echo $"tmsg }}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.