
# *******************************************************
# *** Create the WebSphere profile for Fiper.
# *** This will remove any existing profile with that name first 
# *******************************************************
# *** Configuration Settings.  Edit these before running this script
# *******************************************************

user=fiperacs
pw='YOU-WISH'
profile=AppSrv01
WAS_HOME=/opt/SIMULIA/Express/AppServer

# *******************************************************
# *** End of user-configurable settings
# *******************************************************

profilePath=$WAS_HOME/profiles/$profile
templatePath=$WAS_HOME/profileTemplates/default

PROF_ARGS="-profileName $profile -profilePath $profilePath -templatePath $templatePath"
ADMIN_ARGS="-isDefault true -enableAdminSecurity true -adminUserName $user -adminPassword $pw"
SVC_ARGS="-winserviceCheck true -winserviceAccountType localsystem -winserviceStartupType automatic"

if $WAS_HOME/bin/manageprofiles.sh -getPath -profileName $profile; then
    set -x
    $WAS_HOME/bin/manageprofiles.sh -delete -profileName $profile -username $user -password $pw
    set +x
fi

set -x
rm -rf $profilePath
$WAS_HOME/bin/manageprofiles.sh -create $PROF_ARGS $ADMIN_ARGS
$WAS_HOME/bin/startServer.sh server1 -profileName $profile
