#!/bin/sh

#
# Sample script to accept licenses for the IBM upc compilers
# For AIX:
#    do nothing, license accepted with installp -Y flag
# For Linux:
#    Assumes all compiler software has been installed


OS=`uname`
if [ $OS != "AIX" ]; then
    cd $installroot/
    upc_script=`find opt/ibmcmp/upc -name new_install -print`

    if [ $NODESETSTATE == "install" ] || [ $NODESETSTATE == "boot" ]; then
    #  Being run from a stateful install postscript
       if [ -n "$upc_script" ] ; then
           echo 1 | $upc_script
       fi
    fi

    if [ $NODESETSTATE == "genimage" ]; then
    # Being called from <image>.postinstall script
    # Assume we are on the same machine
       if [ -n "$upc_script" ] ; then
           echo 1 | chroot $installroot /$upc_script
       fi
    fi
fi


