crontab.sh 842 B

123456789
  1. #!/usr/bin/env bash
  2. #
  3. IMAGE=${1:-"docker.local/speedtest:20211029"}
  4. PODNAME="pod_speedtest"
  5. HEADER="#[SPEEDTEST] On certains speedtest server the packet_loss is not displayed so let's define the usage of the following SFR server:
  6. #[SPEEDTEST] - url='http://speedtest.mire.sfr.net:8080/speedtest/upload.php' lat='48.8742' lon='2.3470' name='Paris' country='France' cc='FR' sponsor='SFR' id='12746' host='speedtest.mire.sfr.net:8080'"
  7. echo "Setting the Crontab in place"
  8. (CRONTAB_NOHEADER=Y crontab -l | egrep -v -- '--name connectivity_test|SPEEDTEST|INFLUXDB' ; echo "${HEADER}"; echo "*/5 * * * * /usr/bin/podman pod inspect ${PODNAME} 2>&1 > /dev/null && /usr/bin/podman run --env INFLUXDB* --tty=true --interactive --name=connectivity_test --replace --rm --network=speedtest --pod=${PODNAME} ${IMAGE} 2>&1 > /dev/null") | crontab -