/
awips2.sh
executable file
·89 lines (83 loc) · 1.91 KB
/
awips2.sh
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash -v
#
# Unidata AWIPS envvars
#
# for all users to have 'edex' in $PATH
if [ -d /awips2/edex/bin ]; then
PATH=/awips2/edex/bin:$PATH
fi
# Uncomment below to force AWIPS env vars ONLY for user 'awips'
#if [[ ${USER} != "awips" ]]; then
# return
#fi
if [[ ${USER} = "root" ]]; then
# to avoid ownership corruption of the product queue
# alias to the LDM service (which runs ldm as user awips)
if [ -f /etc/init.d/edex_ldm ]; then
alias ldmadmin='service edex_ldm'
fi
# to avoid python mismatch with yum
export LD_LIBRARY_PATH=/usr/lib64
return
fi
# CAVE alias
alias cave='/awips2/cave/run.sh'
if [ -d /awips2/cave ]; then
export TMCP_HOME=/awips2/cave/caveEnvironment
export FXA_HOME=/awips2/cave/caveEnvironment
fi
# Add to $PATH and $LD_LIBRARY_PATH
add_bin() {
if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
export PATH="${1}/bin:${PATH}"
fi
}
add_dir() {
if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
export PATH="${1}:${PATH}"
fi
}
add_lib() {
if [ -d "$1" ] && [[ ":$LD_LIBRARY_PATH:" != *":$1:"* ]]; then
export LD_LIBRARY_PATH="${1}/lib:${LD_LIBRARY_PATH}"
fi
}
add_all(){
add_bin $1
add_lib $1
}
# add to PATH
add_bin /awips2/java
add_bin /awips2/fxa
add_bin /awips2/groovy
add_bin /awips2/ant
add_bin /awips2/ldm
add_bin /awips2/GFESuite
# add to PATH and LD_LIBRARY_PATH
add_all /awips2/python
add_all /awips2/postgresql
add_all /awips2/psql
add_all /awips2/tools
# add LD_LIBRARY_PATH
add_lib /awips2/yajsw
add_lib /awips2/qpid
add_lib /awips2/ldm
# ldm directories for PATH
add_dir /awips2/ldm/util
add_dir /awips2/ldm/decoders
# _HOME envvars
if [ -d /awips2/ant ]; then
export ANT_HOME=/awips2/ant
fi
if [ -d /awips2/yajsw ]; then
export YAJSW_HOME=/awips2/yajsw
fi
if [ -d /awips2/groovy ]; then
export GROOVY_HOME=/awips2/groovy
fi
if [ -d /awips2/java ]; then
export JAVA_HOME=/awips2/java
fi
if [ -d /awips2/ldm ]; then
export LDMHOME=/awips2/ldm
fi