-
Notifications
You must be signed in to change notification settings - Fork 1
/
init_genpipes
61 lines (53 loc) · 1.12 KB
/
init_genpipes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# This script loads the mugqic stack in on the host
# It also loads the lmod software
export MUGQIC_INSTALL_HOME=/cvmfs/soft.mugqic/CentOS6
usage (){
echo -e "\nUsage: $0 [ [ -V <X.X.X> ] [ <cmd> ]" 1>&2;
echo -e "\nOPTION"
echo -e "\t-V GenPipes version (will default to latest release)"
echo -e "\t-v Vebose mode, makes the parrot talk"
echo
}
export QUIET="-d clear"
while getopts ":vV:h" opt; do
case $opt in
v)
unset QUIET
;;
V)
export PIPELINE_VERSION=/${OPTARG}
;;
h)
usage
exit 0
;;
\?)
usage
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
usage
exit 1
;;
esac
done
shift $((OPTIND-1))
# move the exec line to a script
if [ $# -gt 0 ] ; then
function finish {
rm "${genpipes_script}"
}
genpipes_script=$(mktemp /tmp/genpipes_script.XXXXXX)
trap finish EXIT
chmod 755 "${genpipes_script}"
echo '#!/bin/bash' >> "${genpipes_script}"
echo "$@" >> "${genpipes_script}"
fi
# load cvmfs
if [ "${genpipes_script}" ]; then
bash -ilc "${genpipes_script}"
else
bash -il
fi