--- predict-update.old 2007-01-07 18:42:19.000000000 -0500 +++ predict-update 2007-01-07 18:39:26.000000000 -0500 @@ -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 @@ 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-$$