-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInstall
More file actions
executable file
·82 lines (61 loc) · 1.83 KB
/
Install
File metadata and controls
executable file
·82 lines (61 loc) · 1.83 KB
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
#!/bin/sh
# Name: Install
# Purpose: install script for the femover product
# remember the top-level directory
cd `dirname $0`
TOP=`pwd`
# if no Configuration file, bail out
if [ ! -f "${TOP}/Configuration" ]; then
echo "Missing Configuration file"
exit 1
fi
# source the Configuration file
. "${TOP}/Configuration"
echo "Sourced Configuration file"
# add/update links to the Python executable (for Python 3.7)
DIRS="control gather lib/python postprocess schema testdata unittest/gatherer unittest"
for DIR in ${DIRS}
do
if [ -h ${DIR}/python ]; then
rm ${DIR}/python
fi
ln -s ${PYTHON} ${DIR}/python
echo "Added link from ${DIR}/python to ${PYTHON}"
done
# add/update links to config.py library
CONFIG=${TOP}/lib/python/config.py
for dir in gather control schema postprocess
do
if [ -h "${TOP}/${dir}/config.py" ]; then
rm "${TOP}/${dir}/config.py"
fi
if [ -f "${TOP}/${dir}/config.pyc" ]; then
rm "${TOP}/${dir}/config.pyc"
fi
ln -s "${CONFIG}" "${TOP}/${dir}/config.py"
echo "Created symlink: ${TOP}/${dir}/config.py"
done
# create a symlink to the Configuration file from the control directory
# because it is needed by scripts in that directory
cd ${TOP}/control
rm -f Configuration
ln -s ../Configuration Configuration
# back to top level...
cd "${TOP}"
# if we don't have a data, cache and a logs directory, make them
if [ ! -d ${DATA_DIR} ]; then
mkdir -p ${DATA_DIR}
echo "Created data directory: ${DATA_DIR}"
fi
if [ ! -d ${CACHE_DIR} ]; then
mkdir -p ${CACHE_DIR}
echo "Created cache directory: ${CACHE_DIR}"
fi
if [ ! -d ${LOG_DIR} ]; then
mkdir ${LOG_DIR}
echo "Created log directory: ${LOG_DIR}"
fi
# update permissions on gatherers and controllers
chmod ug+x "${TOP}/gather/"*Gatherer.py "${TOP}/control/"*.py "${TOP}/control"/*.sh
echo "Granted execute permissions for gatherers and control scripts"
echo "Finished"