source: flex_extract.git/setup.sh @ f7b9666

ctbtodev
Last change on this file since f7b9666 was f7b9666, checked in by Anne Philipp <anne.philipp@…>, 4 years ago

generalized the user credentials

  • Property mode set to 100755
File size: 2.4 KB
Line 
1#!/bin/bash
2#
3# @Author: Anne Philipp
4#
5# @Date: September, 10 2018
6#
7# @Description:
8#    This file defines the flex_extract's available installation
9#    parameters and puts them together for the call of the actual
10#    python installation script. It also does some checks to
11#    guarantee necessary parameters were set.
12#
13# @Licence:
14#    (C) Copyright 2014-2019.
15#
16#    SPDX-License-Identifier: CC-BY-4.0
17#
18#    This work is licensed under the Creative Commons Attribution 4.0
19#    International License. To view a copy of this license, visit
20#    http://creativecommons.org/licenses/by/4.0/ or send a letter to
21#    Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
22#
23# -----------------------------------------------------------------
24# AVAILABLE COMMANDLINE ARGUMENTS TO SET
25#
26# THE USER HAS TO SPECIFY THESE PARAMETERS
27#
28TARGET='ecgate'
29MAKEFILE='makefile_ecgate'
30ECUID='<username>'
31ECGID='<groupID>'
32GATEWAY='<gatewayname>'
33DESTINATION='<name>@genericSftp'
34INSTALLDIR=None
35JOB_TEMPLATE=''
36CONTROLFILE='CONTROL_EA5'
37# -----------------------------------------------------------------
38#
39# AFTER THIS LINE THE USER DOES NOT HAVE TO CHANGE ANYTHING !!!
40#
41# -----------------------------------------------------------------
42
43# PATH TO INSTALLATION SCRIPT
44script="Source/Python/install.py"
45
46# INITIALIZE EMPTY PARAMETERLIST
47parameterlist=""
48
49# DEFAULT PARAMETERLIST
50if [ -n "$TARGET" ]; then
51  parameterlist=" --target=$TARGET"
52else
53  echo "ERROR: No installation target specified."
54  echo "EXIT WITH ERROR"
55  exit
56fi
57
58# CHECK FOR MORE PARAMETER
59if [ "$TARGET" == "ecgate" ] || [ "$TARGET" == "cca" ]; then
60  # check if necessary Parameters are set
61  if [ -z "$ECUID" ] || [ -z "$ECGID" ] || [ -z "$GATEWAY" ] || [ -z "$DESTINATION" ]; then
62    echo "ERROR: At least one of the following parameters are not set: ECUID, ECGID, GATEWAY, DESTINATION!"
63    echo "EXIT WITH ERROR"
64    exit
65  else
66    parameterlist+=" --ecuid=$ECUID --ecgid=$ECGID --gateway=$GATEWAY --destination=$DESTINATION"
67  fi
68fi
69if [ -n "$MAKEFILE" ]; then
70  parameterlist+=" --makefile=$MAKEFILE"
71fi
72if [ -n "$FLEXPARTDIR" ]; then # not empty
73  parameterlist+=" --flexpartdir=$FLEXPARTDIR"
74fi
75if [ -n "$JOB_TEMPLATE" ]; then
76  parameterlist+=" --job_template=$JOB_TEMPLATE"
77fi
78if [ -n "$CONTROLFILE" ]; then
79  parameterlist+=" --controlfile=$CONTROLFILE"
80fi
81
82# -----------------------------------------------------------------
83# CALL INSTALLATION SCRIPT WITH DETERMINED COMMANDLINE ARGUMENTS
84
85$script $parameterlist
86
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG