forked from equinor/komodo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
enable.in
executable file
·88 lines (73 loc) · 2.19 KB
/
enable.in
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
# It's very important that the environment variables in this script and enable.csh.in
# have the exact same names. This is because the situation might occour when komodo is
# sourced in csh but disabled in bash
# This function should be kept in sync with the disable_komodo function in
# komodo_job_dispatch in ert-statoil and ert-configurations
disable_komodo () {
if [ -n "${_PRE_KOMODO_PATH:-}" ]
then
PATH="${_PRE_KOMODO_PATH:-}"
export PATH
unset _PRE_KOMODO_PATH
fi
if [ -n "${_PRE_KOMODO_MANPATH:-}" ]
then
MANPATH="${_PRE_KOMODO_MANPATH:-}"
export MANPATH
unset _PRE_KOMODO_MANPATH
fi
if [ -n "${_PRE_KOMODO_LD_LIBRARY_PATH:-}" ]
then
LD_LIBRARY_PATH="${_PRE_KOMODO_LD_LIBRARY_PATH:-}"
export LD_LIBRARY_PATH
unset _PRE_KOMODO_LD_LIBRARY_PATH
fi
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ]
then
hash -r
fi
if [ -n "${_PRE_KOMODO_PS1:-}" ]
then
PS1="${_PRE_KOMODO_PS1:-}"
export PS1
unset _PRE_KOMODO_PS1
fi
unset KOMODO_RELEASE
unset ERT_LSF_SERVER
if [ ! "${1:-}" = "preserve_disable_komodo" ]
then
unset -f disable_komodo
fi
}
# unset irrelevant variables
disable_komodo preserve_disable_komodo
export KOMODO_RELEASE=komodo_release
export _PRE_KOMODO_PATH="$PATH"
export PATH=komodo_prefix/bin${PATH:+:${PATH}}
export _PRE_KOMODO_MANPATH="$MANPATH"
export MANPATH=komodo_prefix/share/man:${MANPATH}
export _PRE_KOMODO_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
unset LD_LIBRARY_PATH
export _PRE_KOMODO_PS1="${PS1:-}"
export PS1="(${KOMODO_RELEASE}) ${PS1}"
local_script=komodo_prefix/../local
if [ -e $local_script ]; then
source $local_script
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r
fi
if [ -d komodo_prefix/../motd/scripts ]
then
for f in komodo_prefix/../motd/scripts/*
do
$f
done
fi
if [ -d komodo_prefix/../motd/messages ]
then
cat komodo_prefix/../motd/messages/*
fi