Skip to content

Commit be53b6e

Browse files
committed
Update run script for better priority and color.
1 parent 83026ad commit be53b6e

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

docker

Submodule docker updated 1 file

run.sh

+13-13
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ function unshift {
1212
FIRST=`head -1 $FILE`
1313
tail -n +2 "$FILE" > $HOME/.landsat-queue.swp
1414
cp $HOME/.landsat-queue.swp $FILE
15-
rm $HOME/.landsat-queue.swp
1615
echo $FIRST
1716
}
1817

@@ -28,13 +27,14 @@ fi
2827
echo "" > $RUNNING
2928

3029
if [ ! $1 ]; then
31-
echo -e "\e[33m$dt\e[0m Not specify landsat id, use ~/.landsat-queue instead"
32-
if [ !-f $QUEUE ]; then
30+
echo -e "\e[33m$dt\e[0m Not specify landsat id, use ~/.landsat-queue instead."
31+
if [ ! -f $QUEUE ]; then
3332
echo -e "\e[33m$dt\e[0m File not found at $HOME/.landsat-queue, stop."
3433
exit 0
3534
else
3635
LAST=`unshift $QUEUE`
37-
if [ -n "$last" ] && [ ! -d "$OUTPUTDIR/procssed/$LANDSAT" ]; then
36+
echo $LAST;
37+
if [ -n "$LAST" ] && [ ! -f "$OUTPUTDIR/procssed/$LAST/rgb.jpg" ]; then
3838
LANDSAT=$LAST
3939
fi
4040
fi
@@ -43,37 +43,37 @@ else
4343
fi
4444

4545
if [ -z "$LANDSAT" ]; then
46-
echo "\e[31m$dt\e[0m Cannot find any landsat id in queue or argument"
46+
echo -e "\e[31m$dt\e[0m Cannot find any landsat id in queue or argument"
4747
exit 1
4848
else
4949
echo "$LANDSAT" > $RUNNING
5050
fi
5151

5252
dt=`date '+%Y-%m-%d %H:%M:%S'`
53-
echo -e "\e[42m$dt Start process $LANDSAT e[0m"
54-
echo -e "\e[32m$dt\e[0m Download"
53+
echo -e "\e[42m$dt Start process $LANDSAT\e[0m"
54+
echo -e "\e[34m$dt\e[0m Download"
5555
docker run --rm -it -v $OUTPUTDIR:/root/landsat developmentseed/landsat-util:latest landsat download $LANDSAT -b 2345
5656

5757
dt=`date '+%Y-%m-%d %H:%M:%S'`
58-
echo -e "\e[32m$dt\e[0m Process rgb"
58+
echo -e "\e[34m$dt\e[0m Process rgb"
5959
docker run --rm -it -v $OUTPUTDIR:/root/landsat developmentseed/landsat-util:latest landsat process /root/landsat/downloads/$LANDSAT
6060

6161
dt=`date '+%Y-%m-%d %H:%M:%S'`
62-
echo -e "\e[32m$dt\e[0m Process NDVI"
62+
echo -e "\e[34m$dt\e[0m Process NDVI"
6363
docker run --rm -it -v $OUTPUTDIR:/root/landsat developmentseed/landsat-util:latest landsat process /root/landsat/downloads/$LANDSAT --ndvi
6464

6565
dt=`date '+%Y-%m-%d %H:%M:%S'`
66-
echo -e "\e[32m$dt\e[0m Generate tiles"
66+
echo -e "\e[34m$dt\e[0m Generate tiles"
6767
docker run --rm --entrypoint /home/twlandsat/scripts/gdal2tiles.sh -v $OUTPUTDIR:/root/landsat jimyhuang/twlandsat $LANDSAT ${LANDSAT}_bands_432.TIF tiles-rgb
6868
docker run --rm --entrypoint /home/twlandsat/scripts/gdal2tiles.sh -v $OUTPUTDIR:/root/landsat jimyhuang/twlandsat $LANDSAT ${LANDSAT}_NDVI.TIF tiles-ndvi
6969

7070
dt=`date '+%Y-%m-%d %H:%M:%S'`
71-
echo -e "\e[32m$dt\e[0m Generate preview"
72-
docker run --rm --entrypoint /home/twlandsat/scripts/imagemagick.sh -v $OUTPUTDIR:/root/landsat jimyhuang/twlandsat $LANDSAT ${LANDSAT}_bands_432.TIF -scale 25% rgb.jpg
71+
echo -e "\e[34m$dt\e[0m Generate preview"
7372
docker run --rm --entrypoint /home/twlandsat/scripts/imagemagick.sh -v $OUTPUTDIR:/root/landsat jimyhuang/twlandsat $LANDSAT ${LANDSAT}_NDVI.TIF -scale 25% ndvi.jpg
73+
docker run --rm --entrypoint /home/twlandsat/scripts/imagemagick.sh -v $OUTPUTDIR:/root/landsat jimyhuang/twlandsat $LANDSAT ${LANDSAT}_bands_432.TIF -scale 25% rgb.jpg
7474

7575
dt=`date '+%Y-%m-%d %H:%M:%S'`
76-
echo -e "\e[32m$dt\e[0m Final clear"
76+
echo -e "\e[34m$dt\e[0m Final clear"
7777
echo "" > $RUNNING
7878
if [ -d "$OUTPUTDIR/downloads/$LANDSAT" ]; then
7979
rm -Rf "$OUTPUTDIR/downloads/$LANDSAT"

0 commit comments

Comments
 (0)