#!/usr/bin/env bash set -eau -o pipefail ARCEP_WWW="https://www.data.gouv.fr/fr/datasets/le-marche-du-haut-et-tres-haut-debit-fixe-deploiements/" if [ "$#" -ne 2 ]; then echo "Usage: ingest path-to-arcep-ipe-csv-file path-to-generated-db" echo "ARCEP file can be downloaded here: ${ARCEP_WWW} or with script fetch_latest_arcep.sh" echo "" exit 1 fi fullIpePath=$(realpath "${1}") fullDbPath=$(realpath "${2}") tmpSql=$(mktemp) clean_tmp () { rm "${tmpSql}" } trap clean_tmp EXIT echo "[+] Ingesting IPE data from ${fullIpePath}" echo "" cat > "${tmpSql}" < "${tmpSql}" < "${tmpSql}" <