#!/bin/bash # $HeadURL$ $LastChangedRevision$ echo "setting up environment ..." export PIN_DIR=$(pwd) PIN_DB=xxx echo "$PIN_DB:false:unused:unsearchable" > databases.conf > $PIN_DB for HOST in local_host some_remote_host; do for PID in existent_pid non_existent_pid; do echo "test $HOST/$PID ..." echo " creating locks ..." echo $(if [ $HOST = local_host ]; then uname -n; else echo $HOST; fi) > $PIN_DB.host echo $(if [ $PID = existent_pid ]; then echo $$; else echo 99999; fi) > $PIN_DB.pid echo " testing how pin reacts to those locks ..." EDITOR=cat pin -P $PIN_DB 2>&1 | sed -r -e "s/(\/.*\/)/VARIANT_TEXT\//" -e "s/$$/existent_pid/g" -e "s/99999/non_existent_pid/g" -e 's/^/ /' echo " checking for leftovers ..." ls -1 $PIN_DB.host $PIN_DB.pid 2>&1 | sed 's/^/ /' echo " cleaning up ..." rm -f $PIN_DB.host $PIN_DB.pid echo done done echo "all done"