Script for resizing

#!/bin/sh
# The purpose of this script is to inform 
# an application of a resize event.  
#
# You can identify the application by: 
#
#   1. LSF job ID ($LSB_JOBID), or 
#   2. pid ($LS_JOBPID).
 
# handle the 'grow' event
if [ $LSB_RESIZE_EVENT = "grow" ]; then
 
    # Inform the application that it can use 
    # additional tasks as specified in 
    # $LSB_RESIZE_HOSTS. 
    #
    # Exit with $LSB_RESIZE_NOTIFY_FAIL if 
    # the application fails to resize.
    #
    # If the application cannot use any
    # additional resources, you may want 
    # to run ‘bresize cancel $LSB_JOBID’
    # before exit.
 
    exit $LSB_RESIZE_NOTIFY_OK
fi
 
# handle the 'shrink' event
if [ $LSB_RESIZE_EVENT = "shrink" ]; then
 
    # Instruct the application to release the
    # tasks specified in $LSB_RESIZE_HOSTS.
    #
    # Exit with $LSB_RESIZE_NOTIFY_FAIL if 
    # the resources cannot be released.
    
    exit $LSB_RESIZE_NOTIFY_OK
fi
 
# unknown event -- should not happen
exit $LSB_RESIZE_NOTIFY_FAIL