2019-04-23 10:10:04 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
naopassa=$(wget http://www.dgterritorio.pt/cartografia_e_geodesia/cartografia/cartografia_de_base___topografica_e_topografica_de_imagem/serie_cartografica_1500_000/ -o /dev/null -O - |html2text|grep atualiz|grep :|cut -d: -f2|grep -c 2017)
|
2019-04-23 10:19:00 +00:00
|
|
|
naopassa=$((naopassa + $(wget http://www.dgterritorio.pt/cartografia_e_geodesia/cartografia/carta_administrativa_oficial_de_portugal_caop/caop__download_/carta_administrativa_oficial_de_portugal___versao_2018__em_vigor_/ -o /dev/null -O - |html2text|grep atualiz|grep :|cut -d: -f2|grep -c "janeiro de 2019")))
|
2019-04-23 10:10:04 +00:00
|
|
|
|
2019-04-23 10:19:00 +00:00
|
|
|
if [ "$naopassa" -ge "1" ]; then
|
2019-04-23 10:10:04 +00:00
|
|
|
echo "dgt: Incumprimento mantém-se, a actualizar o README (faça um git diff, valide, e commit!)";
|
|
|
|
while IFS='' read -r line || [[ -n "$line" ]]; do
|
|
|
|
test "$(echo "$line"|grep -v -c "dgterritorio")" -eq "1" \
|
|
|
|
&& echo "$line" \
|
|
|
|
|| (h=$(echo "$line"|cut -d\| -f1-4); t=$(echo "$line"|cut -d\| -f6-); echo "$h| $(date +%Y/%m/%d) |$t");
|
|
|
|
done < README.md > new
|
|
|
|
mv new README.md
|
|
|
|
else
|
|
|
|
echo "dgt: incumprimento resolvido";
|
|
|
|
fi
|