GenAppTran.sh

From radmind

Revision as of 10:43, 6 June 2007 by Mcneal (Talk | contribs)
Jump to: navigation, search

This is a very rough script. Use at your own risk.

This script will create and store a transcript for each application in ./Applications. This is handy for creating transcripts for multiple drag-and-drop applications at once. To use:

  1. Download GenAppTran.sh
  2. Make GenAppTran.sh executable
  3. Modify GenAppTran.sh with your radmind server information
  4. Create an "Applications" directory
  5. Drag applications to new directory
  6. Set desired permissions
  7. Run GenAppTran.sh from Applications parent directory
#!/bin/sh
# GenAppTran.sh by Patrick McNeal
# Copyright University of Michigan 2007

IFS="
"
HOST=RADMINDSERVER
FSDIFF=/usr/local/bin/fsdiff
LCREATE=/usr/local/bin/lcreate
PING=/sbin/ping

$PING -q -c 1 $HOST > /dev/null 2>&1

if [ $? -ne 0 ]; then
	echo "Unable to find radmind server $HOST"
	exit 1
fi

for APPLICATION in `ls Applications`;do
	if [ $APPLICATION = ".DS_Store" ]; then
		continue;
	fi
	TRANSCRIPT=`echo $APPLICATION | sed 's/[ ]//g'`
	TRANSCRIPT=`echo $TRANSCRIPT | sed 's/.app$/.T/'`
	echo "Createing appliation transcript for $APPLICATION..."
	echo "\tCreating transcript $TRANSCRIPT..."
	$FSDIFF -C -c sha1 -K /dev/null ./Applications/$APPLICATION | grep -v "/.DS_Store" > /tmp/$TRANSCRIPT
	echo "\tStoring $TRANSCRIPT..."
	$LCREATE -q -h $HOST /tmp/$TRANSCRIPT
	echo "\tCleaning up $TRANSCRIPT..."
	rm /tmp/$TRANSCRIPT
	echo "Done."

done
Personal tools