7
0
mirror of https://github.com/marado/RNID.git synced 2024-12-22 11:55:59 +00:00
rnid/scripts/02-economia.sh

23 lines
976 B
Bash
Raw Normal View History

#!/bin/bash
2021-06-06 14:39:25 +00:00
fail=0;
2024-10-18 19:31:33 +00:00
if [ "$(curl -s https://www.dgae.gov.pt -o /dev/null; echo $?)" -eq "60" ]; then
2021-06-06 14:39:25 +00:00
echo "economia: problema com o certificado SSL";
fail=1;
elif [ "$(curl -s -I https://www.dgae.gov.pt/gestao-de-ficheiros-externos-dgae-ano-2015/1_formulario-registo_mf_nao_harmonizadas-doc.aspx|grep filename|cut -d= -f2| tr -d '\r')" == "i010066.doc" ]; then
echo "economia: ficheiro em formato proprietário";
fail=1;
fi
2021-08-08 14:27:51 +00:00
if [ "$fail" = 0 ]; then
echo "economia: incumprimento pode já não existir";
else
echo "economia: 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 min-economia|wc -l) -eq "1" \
&& echo "$line" \
2024-10-18 19:31:33 +00:00
|| (h=$(echo "$line"|cut -d\| -f1-4); t=$(echo "$line"|cut -d\| -f6-); nc=$(echo "$line"|cut -d\| -f5 | wc -m); printf "%s| %-$((nc-2))s|%s\n" "$h" "$(date +%Y/%m/%d)" "$t");
done < README.md > new
mv new README.md
fi