diff --git a/fip.sh b/fip.sh index ff9dc44..eeeb9f6 100644 --- a/fip.sh +++ b/fip.sh @@ -38,19 +38,14 @@ function print_data() { md5="" while true; do - # Exécuter la commande curl pour obtenir les données JSON json_data=$(curl -s "https://www.radiofrance.fr/fip/api/webradios?station=fip") - # Calculer le hachage MD5 des données JSON actuelles new_md5=$(echo -n "$json_data" | md5sum | awk '{print $1}') - # Vérifier si le hachage MD5 a changé (c'est-à-dire si les données ont changé) if [ "$new_md5" != "$md5" ]; then - # Afficher les données en utilisant la fonction print_data print_data "$json_data" md5="$new_md5" fi - - # Attendre 5 secondes avant la prochaine requête curl + sleep 5 done \ No newline at end of file