-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall.sh
196 lines (164 loc) · 4.98 KB
/
install.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
#!/bin/bash
################################################################################
# Copyright 2014 Samuel Gongora Garcia (s.gongoragarcia@gmail.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
# Author: s.gongoragarcia[at]gmail.com
################################################################################
DIR=$(pwd)
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential -y
sudo apt-get install python-dev -y
# it seems that wine could give problems in 64 bits architectures
# must correct that issue
echo "Orbitron's installation"
sudo apt-get install wine -y
if `wget -qr http://www.stoff.pl/orbitron/files/orbitron.exe -O orbitron.exe`; then
echo "Install Orbitron at default directory"
else
if `wget -qr http://orbitron.fox07.de/orbitron.exe -O orbitron.exe`; then
echo "Install Orbitron at default directory"
else
if `wget -qr http://orbitron.dreddi.net/orbitron.exe -O orbitron.exe`; then
echo "Install Orbitron at default directory"
else
echo "Orbitron couldn't be downloaded"
fi
fi
fi
wine orbitron.exe
rm orbitron.exe
# Python libraries.
echo "Python libraries"
sudo apt-get install python-pip -y
sudo apt-get install python-matplotlib -y
sudo pip install pyephem
sudo pip install pyorbital
# Compile Predict.
sudo apt-get install libncurses5-dev -y
sudo apt-get install libncursesw5-dev -y
cd predict-mod
sudo ./configure
cd ..
# Remove trash.
sudo apt-get autoremove
clear
cd ~
echo "========================="
echo "= Please select folder: ="
echo "========================="
select D in */ ; do
test -n "$D" && break;
echo ">>> Invalid Selection";
done
echo " "
OPT="Yes No New_folder"
echo "$D is all right?"
select opt in $OPT;do
if [ "$opt" = "Yes" ]; then
cd "$D"
echo -e "Folder $D selected!"
INSDIR="$D"
break
elif [ "$opt" = "No" ]; then
cd "$D"
clear
echo "========================="
echo "= Please select folder: ="
echo "========================="
select SD in */ ; do
test -n "$SD" && break;
echo ">>> Invalid Selection";
done
echo " "
OPT="Yes No"
echo "$SD is all right?"
select opt in $OPT;do
if [ "$opt" = "Yes" ]; then
cd "$SD"
echo -e "Folder $SD selected!"
INSDIR="$D$SD"
break
elif [ "$opt" = "No" ]; then
cd "$D"
clear
echo "========================="
echo "= Please select folder: ="
echo "========================="
select SSD in */ ; do
test -n "$SSD" && break;
echo ">>> Invalid Selection";
done
INSDIR="$D$SD$SSD"
break
else
echo ">>> Invalid Selection";
fi
done
break
elif [ "$opt" = "New_folder" ]; then
echo "Name..."
read -e NEW_FOLDER
mkdir $NEW_FOLDER
echo "========================="
echo "= Please select folder: ="
echo "========================="
select SD in */ ; do
test -n "$SD" && break;
echo ">>> Invalid Selection";
done
echo -e "Folder $SD selected!"
INSDIR="$D"
break
else
echo ">>> Invalid Selection";
fi
done
echo "Installation folder ~/$INSDIR"
cd $DIR
echo "Creating directories"
TEMPTLES="TLEs"
mkdir ~/$INSDIR$TEMPTLES # TLEs folder
TEMPRESULTS="results"
mkdir ~/$INSDIR$TEMPRESULTS
mkdir ~/$INSDIR$TEMPRESULTS/predict # predict simulations
mkdir ~/$INSDIR$TEMPRESULTS/PyEphem # PyEphem simulations
mkdir ~/$INSDIR$TEMPRESULTS/PyOrbital # PyOrbital simulations
mkdir ~/$INSDIR$TEMPRESULTS/Orbitron # Orbitron simulations
mkdir ~/$INSDIR$TEMPRESULTS/STK # STK simulations
echo "Copying files"
# Main routine
cp main.sh ~/$INSDIR # BASH script
# Window routine
cp output_data.py ~/$INSDIR # Output data to GUI
cp gui.py ~/$INSDIR # UI
cp configure_simulations.py ~/$INSDIR # Auxiliary UI
cp scrolledlist.py ~/$INSDIR # List
# Propagators
cp pyephem_sims.py ~/$INSDIR # PyEphem script
cp pyorbital_sims.py ~/$INSDIR # PyOrbital script
cp predict_sims.sh ~/$INSDIR # predict script
# Auxiliary scripts
cp get_elements.py ~/$INSDIR # Get elements from TLE
cp get_names.py ~/$INSDIR # Get satellite names from TLE file
cp update_tles.sh ~/$INSDIR # Update TLE files from Celestrak
# Output scripts
cp output_Orbitron.py ~/$INSDIR
cp output_PyOrbital.py ~/$INSDIR
cp output_PyEphem.py ~/$INSDIR
cp output_STK.py ~/$INSDIR
cp output_predict.py ~/$INSDIR