#!/bin/sh
# Sample supplied script to log each occurrence of 'no AS license available'

# This script is automatically run with a parameter of cobdir path, whenever
# the licensing system detects this event.

# THIS SCRIPT WILL ONLY RUN IF OWNED BY ROOT AND IS NOT USER WRITEABLE

# The administrator may change this script to tailor to his/her needs. 
# Editable access to non-priveleged users should not be allowed, since this
# script may be invoked by user processes with root permissions.

# Note that attempting to run a cobol application from this script, will fail
# due there being no licenses available. The licensing system will detect this
# and not attempt to recursively run this script. 
#-----------------------------------------------------------------------------

# Append into a logfile
if test ! -f /var/mfaslmf/USERLOG
then
	touch /var/mfaslmf/USERLOG
	chmod 666 /var/mfaslmf/USERLOG
fi	
echo `date`:No license  $* >> /var/mfaslmf/USERLOG

#mail a specified user (commented out by default. substitute the user name)
# echo `date`:No license  $* > /var/mfaslmf/tmpmess$$
# mail -s "No AS license"  user-name  < /var/mfaslmf/tmpmess$$
# rm /var/mfaslmf/tmpmess$$
