forked from rslab-ntua/senet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
snappy_conf_perm.sh
executable file
·51 lines (44 loc) · 1.35 KB
/
snappy_conf_perm.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
# Install snappy permanently to Python (works on virtual enviroments also)
# File created for MAGO Project
# Alekos Falagas ([email protected])
echo "Provide SNAP installation path:"
read -p "Is installation path /home/eouser/$USER/esa-snap/ and auxiliary path /home/eouser/$USER/.snap? [Y/n] " ANSWER
case "$ANSWER" in
[yY] | [yY][eE][sS])
SNAP_INSTALLATION_FOLDER="/home/eouser/$USER/esa-snap"
SNAP_AUX_FOLDER="/home/eouser/$USER/.snap"
;;
[nN] | [nN][oO])
read -p "Provide installation path: " SNAP_INSTALLATION_FOLDER
read -p "Provide auxiliary path: " SNAP_AUX_FOLDER
;;
*)
echo "Error: Invalid option."
exit 1
;;
esac
# Check if folders exist
if [ ! -d $SNAP_INSTALLATION_FOLDER ]
then
echo "Error: Directory $SNAP_INSTALLATION_FOLDER does not exists."
exit 2
fi
if [ ! -d $SNAP_AUX_FOLDER ]
then
echo "Error: Directory $SNAP_AUX_FOLDER does not exists."
exit 2
fi
SNAPPY_DIR=$SNAP_AUX_FOLDER"/snap-python/snappy/"
if [ ! -d $SNAPPY_DIR ]
then
echo "Error: Directory $SNAPPY_DIR does not exists. Try to configure snappy with $SNAP_INSTALLATION_FOLDER/bin/snappy_conf"
exit 2
fi
read -p "Provide Python executable (e.g /usr/bin/python3):" PYTHON_PATH
if [ ! -f $PYTHON_PATH ]
then
echo "Error: Provided python path does not exist."
exit 2
fi
#Installing snappy
$PYTHON_PATH $SNAPPY_DIR"/setup.py" install