Skip to content

Instantly share code, notes, and snippets.

@RaphaelChochon
RaphaelChochon / weewx_restart.sh
Created August 24, 2018 21:22
Script permettant de surveiller l'état d'une instance de Weewx (sur un Raspberry par exemple) et de le redémarrer si nécessaire
#!/bin/bash
# Script a faire tourner avec bash de cette maniere : /bin/bash /script/a/executer/weewx_restart.sh >/dev/null 2>&1
# Exemple en crontab : */5 * * * * /bin/bash /script/a/executer/weewx_restart.sh >/dev/null 2>&1
# Nom du service à surveiller :
service=weewx
if (( $(ps -ef | grep -v grep | grep $service | wc -l) > 0 ))
then
echo "$service is running !!!"
@RaphaelChochon
RaphaelChochon / generate_romma_txt.php
Created March 16, 2018 15:11
Génération d'un fichier texte pour l'intégration d'une station météo (Davis VP2) sous Weewx et MySQL au réseau de l'association ROMMA
<?php
/*
* Script permettant de générer un fichier texte selon les recommandations de l'association ROMMA
* (Réseau d'Observation Météo du Massif Alpin) pour une intégration à leur réseau d'une station
* météo (Davis VP2) fonctionnant sous le logiciel WEEWX sur une base de données MySQL.
*
* Dérivé d'un script issu du travail de XavierJ du forum d'Infoclimat et
* disponible ici : https://github.com/xavfmp/meteo
* Fonction pour la moyenne d'angles : https://gist.github.com/carloscabo/96e70853f1bb6b6a4d33e4c5c90c6cbb