7
0
mirror of https://github.com/marado/RNID.git synced 2024-12-21 19:44:04 +00:00

novo teste: scripts/14-mai.sh

This commit is contained in:
Marcos Marado 2018-05-20 19:13:37 +01:00
parent a63997fd46
commit 742f4d3208
2 changed files with 793 additions and 0 deletions

14
scripts/14-mai.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
wget https://www.sg.mai.gov.pt/AdministracaoEleitoral/RecenseamentoEleitoral/ResultadosRecenseamento/Paginas/default.aspx -o /dev/null -O -|grep -v __REQUESTDIGEST|grep -v VIEWSTATE > mai
if [ ! "$(diff mai scripts/14/mai|wc -l)" -eq "0" ]; then
echo "mai: incumprimento pode já não existir";
else
echo "mai: 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 sg.mai|wc -l) -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
fi
rm mai

779
scripts/14/mai Normal file

File diff suppressed because one or more lines are too long