"Fossies" - the Fresh Open Source Software Archive

Member "unicore-ucc-8.0.2/bin/ucc" (18 May 2020, 1837 Bytes) of package /linux/misc/unicore-ucc-8.0.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "ucc": 8.0.0_vs_8.0.1.

    1 #!/bin/bash
    2 #
    3 # Startup script for the UNICORE Commandline client
    4 #
    5 
    6 #
    7 # Installation directory
    8 #
    9 dir=`dirname $0`
   10 if [ "${dir#/}" = "${dir}" ]
   11 then
   12   if [ "$dir" != "." ]
   13   then
   14     dir="$(pwd)/$dir"
   15   else
   16     dir="$(pwd)"
   17   fi
   18 fi
   19 
   20 
   21 INST="${dir%/bin}"
   22 
   23 #Alternatively specify the absolute path of the installation dir here
   24 #INST=
   25 
   26 
   27 if [ ! -e ${HOME}/.ucc/ ]; then
   28     echo Creating UCC user\'s preferences directory ${HOME}/.ucc
   29     mkdir -m 700 ${HOME}/.ucc/
   30     mkdir -p ${HOME}/.ucc/trusted-certs
   31 fi
   32 
   33 CONFIG_FILES="preferences extensions user-keystore.jks"
   34 for f in $CONFIG_FILES; do
   35     C_F=${HOME}/.ucc/$f
   36     if [ ! -e "$C_F" -a -e "${INST}/conf/$f" ]; then
   37         cp "${INST}/conf/$f" "$C_F"
   38         chmod 600 "$C_F"
   39     fi
   40 done
   41 
   42 
   43 #
   44 # Java command 
   45 #
   46 JAVA=${JAVA:-java}
   47 
   48 #
   49 # Options to the Java VM
   50 #
   51 
   52 #
   53 # helper function to set an option if it is not already set
   54 #
   55 # arg1: option name (without leading "-", e.g "Ducc.extensions")
   56 # arg2: option value (e.g. =conf/extensions)
   57 #
   58 Options=( )
   59 set_option(){
   60     if [[ "$UCC_OPTS" != *$1* ]]
   61     then
   62         N=${#Options[*]}
   63         Options[$N]="-$1$2"
   64     fi
   65 }
   66 
   67 
   68 #
   69 # Memory for the VM
   70 #
   71 set_option "Xmx" "128m"
   72 
   73 #
   74 # default location of user preferences file
   75 #
   76 set_option "Ducc.preferences" "=${HOME}/.ucc/preferences"
   77 
   78 #
   79 # log configuration
   80 #
   81 set_option "Dlog4j.configuration" "=file://${INST}/conf/logging.properties"
   82 
   83 # set this one if you have ssl problems and need debug info
   84 #set_option "Djavax.net.debug" "=ssl,handshake"
   85 
   86 #
   87 # put all jars in lib/ on the classpath
   88 #
   89 CP=.$(find "$INST/lib" -name "*.jar" -exec printf ":{}" \; )
   90 
   91 
   92 if [ -d ${HOME}/.ucc/lib ]
   93 then
   94 #
   95 # put all jars in ${HOME}/.ucc/lib/ on the classpath
   96 #
   97 CP=$CP:$(find "${HOME}/.ucc/lib" -name "*.jar" -exec printf ":{}" \; )
   98 fi
   99     
  100 export CLASSPATH=$CP
  101 
  102 #
  103 # go
  104 #
  105 $JAVA "${Options[@]}" ${DEFS} ${UCC_OPTS} de.fzj.unicore.ucc.UCC ${1+"$@"}
  106 
  107 
  108 
  109