summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sci-astronomy/predict/files/predict-update')
-rw-r--r--sci-astronomy/predict/files/predict-update20
1 files changed, 12 insertions, 8 deletions
diff --git a/sci-astronomy/predict/files/predict-update b/sci-astronomy/predict/files/predict-update
index d218fd18ed6d..b0634e148e46 100644
--- a/sci-astronomy/predict/files/predict-update
+++ b/sci-astronomy/predict/files/predict-update
@@ -1,8 +1,7 @@
#!/bin/sh
-PV=
+oldpwd=$PWD
if [ ! -f ~/.predict/predict.tle ]; then
- oldpwd=$PWD
mkdir -p ~/.predict
cd ~/.predict
cat > predict.tle << EOF
@@ -79,10 +78,15 @@ STARSHINE 3
1 26929U 02216.67548843 .00042169 00000-0 00000-0 0 9
2 26929 67.0426 246.5544 0011326 237.9129 122.0981 15.57367567 47636
EOF
- cd $oldpwd
fi
-wget -qc www.celestrak.com/NORAD/elements/amateur.txt -O /tmp/amateur.txt
-wget -qc www.celestrak.com/NORAD/elements/visual.txt -O /tmp/visual.txt
-wget -qc www.celestrak.com/NORAD/elements/weather.txt -O /tmp/weather.txt
-predict -u /tmp/amateur.txt /tmp/visual.txt /tmp/weather.txt
-rm /tmp/amateur.txt /tmp/visual.txt /tmp/weather.txt
+
+mkdir /tmp/predict-$$ || exit 1
+cd /tmp/predict-$$
+
+wget -qc www.celestrak.com/NORAD/elements/amateur.txt -O ./amateur.txt
+wget -qc www.celestrak.com/NORAD/elements/visual.txt -O ./visual.txt
+wget -qc www.celestrak.com/NORAD/elements/weather.txt -O ./weather.txt
+predict -u ./amateur.txt ./visual.txt ./weather.txt
+
+cd ${oldpwd}
+rm -fr /tmp/predict-$$