forked from sunnyvale-it/chieri-calendari-raccolta-rifiuti
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_me.sh
executable file
·32 lines (27 loc) · 1.1 KB
/
run_me.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
#!/bin/bash
declare -a zones=($(cat comuni.txt | tr '[a-z]' '[A-Z]' | sed 's/ //g'))
declare -a years=(
"2021"
)
for year in "${years[@]}"
do
# mkdir -p coordinates/$year
mkdir -p CSVs/${year}
mkdir -p ICSs/${year}
# ./generate_coordinates.sh $year
done
for zone in "${zones[@]}"
do
for year in "${years[@]}"
do
mkdir -p PDFs/$year
curl -s -o PDFs/$year/${zone}_${year}.pdf http://www.ccs.to.it/flex/Extensions/appCCSCalendario/pages/serveDownload.php\?a\=${year}\&f\=${zone}.pdf\&t\=raccolta
if test -f PDFs/$year/${zone}_${year}.pdf; then
echo "PDF file PDFs/$year/${zone}_${year}.pdf downloaded"
fi
if test -f "PDFs/${year}/${zone}_${year}.pdf" && test -f "coordinates/${year}/${zone}_${year}_coordinates.csv"; then
echo "Processing file PDFs/${year}/${zone}_${year}.pdf using coordinates from coordinates/${year}/${zone}_${year}.csv"
java -jar target/chieri-calendari-raccolta-rifiuti-1.0-SNAPSHOT-jar-with-dependencies.jar ${zone} PDFs/${year}/${zone}_${year}.pdf coordinates/${year}/${zone}_${year}_coordinates.csv ${year} CSVs/${year} ICSs/${year}
fi
done
done