GenAppTran.sh

From radmind

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 (c) 2007 Regents of The University of Michigan.
# All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appears in all copies and
# that both that copyright notice and this permission notice appear
# in supporting documentation, and that the name of The University
# of Michigan not be used in advertising or publicity pertaining to
# distribution of the software without specific, written prior
# permission. This software is supplied as is without expressed or
# implied warranties of any kind.
#
# Research Systems Unix Group
# The University of Michigan
# c/o Wesley Craig
# 4251 Plymouth Road B1F2, #2600
# Ann Arbor, MI 48105-2785
# radmind@umich.edu
# http://rsug.itd.umich.edu/software/radmind/

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