7
0
mirror of https://github.com/marado/RNID.git synced 2024-09-20 00:45:17 +00:00
rnid/scripts/04-rtp.sh

27 lines
959 B
Bash
Raw Normal View History

2018-05-20 14:25:08 +00:00
#!/bin/bash
# RTP - flash e WMV
2018-05-26 02:05:51 +00:00
flash=$(wget http://media.rtp.pt/empresa/utilizacao/flash-player/ --user-agent="Mozilla/5.0 Gecko/20100101 Firefox/21.0" -o /dev/null -O -|wc -l)
wmv=$(wget http://media.rtp.pt/empresa/utilizacao/windows-media-player/ --user-agent="Mozilla/5.0 Gecko/20100101 Firefox/21.0" -o /dev/null -O -|wc -l)
2018-05-20 14:25:08 +00:00
2018-05-26 02:05:51 +00:00
mudancas=0;
if [ "$flash" -eq "0" ]; then
echo "RTP: Flash: incumprimento pode já não existir";
mudancas=1;
fi
if [ "$wmv" -eq "0" ]; then
echo "RTP: WMV: incumprimento pode já não existir";
mudancas=1;
fi
if [ "$mudancas" -eq "0" ]; then
echo "RTP: 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 rtp|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