Plan 9 from Bell Labs’s /usr/web/sources/contrib/nemo/rc/bin/env/uam2who

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


#!/bin/rc
# gather /who info from uam bb, to merge
# their staff into our ctx.

while(;){		
    persons=`{hget 'http://odisea.ii.uam.es:8080/interact/bb/get/person/*' |
	grep 'entity name' | awk '-F"' '{print $2}' }
    for (p in $persons){
	if (echo $p | grep '[^a-zA-Z]'){
		echo UAM user with bad name $p
		exits name
	}
	if (! test -d /who/$p ){
		mkdir /who/$p
		chmod ug+rwx /who/$p
		cp /who/none/face.gif /who/$p/face.gif
		echo none >/who/$p/letters
		echo away >/who/$p/status
		echo none >/who/$p/where
		echo uam  >/who/$p/domain
	}
	loc=`{ { hget http://odisea.ii.uam.es:8080/interact/bb/get/person/$p/rels/locatedAt
	   ; echo 'loc="none" type="3"' } |grep 'type="3"' | sed 1q | awk -F'"' '{print $2}' }
	if (~ $loc none)
		echo away >/who/$p/status
	if not
		echo online >/who/$p/status
	echo $loc >/who/$p/where
    }
    sleep 300
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].