#!/bin/csh -f
# glassfish
# -----------------------------------------------------------------------------
# Shell script to start and stop GlassFish server
# -----------------------------------------------------------------------------
# Usage:  See Usage section below or run with -h or --help option to see usage.
# Assumptions:
# Effects:
# - Performs operations on the GlassFish server.
# Notes:
# Implementation Notes:
# Portability Issues:
# Revision History:
#   $Log$
# -----------------------------------------------------------------------------

if ($#argv == 0 || "$1" == "-h" || "$1" == "--help") then
   echo "Usage: "
   echo "  $0:t start         Start GlassFish server"
   echo "  $0:t stop          Stop GlassFish server"
   echo "  $0:t admin         Show the GlassFish admin server"
   exit 1
endif

if ($#argv == 1) then

   if ("$1" == "start") then
      asadmin start-domain domain1
   else if ("$1" == "stop") then
      asadmin stop-domain domain1
   else if ("$1" == "admin") then
      open http://localhost:4848
   else
      echo "Invalid parameter"
      $0 --help
   endif

else
   echo "Invalid number of parameters"
   $0 --help
endif

exit 0