From 7b1699d3ec9833900bf8fef3b22acfec980a7d1b Mon Sep 17 00:00:00 2001 From: Christoffer Date: Mon, 10 Dec 2018 18:44:12 +0100 Subject: [PATCH] Updated README.md --- README.md | 2 +- roagen.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1df8f1a..b11b1dc 100644 --- a/README.md +++ b/README.md @@ -10,4 +10,4 @@ 6. Verify everything work by running `cd ~/dn42/dn42-rpki-export.json/ && php roagen.php`. 7. In $USER crontab file put `14 */3 * * * cd ~/dn42/dn42-rpki-export.json/ && php roagen.php`. Finetune time between runs to your liking. -NB: The roagen.php script is written with the paths to the dn42 registry folder being they reside in the same parent folder. +NB: The roagen.php script is written with the paths to the dn42 registry folder being both git repositories reside in the same parent folder. diff --git a/roagen.php b/roagen.php index 3e057fa..9642182 100755 --- a/roagen.php +++ b/roagen.php @@ -1,6 +1,6 @@ &1"); +echo shell_exec("/usr/bin/git -C ../registry/ pull origin master:master 2>&1"); function startsWith($haystack, $needle) { @@ -19,13 +19,13 @@ function endsWith($haystack, $needle) } $roas = array(); -$files = scandir('../dn42-registry/data/route6/'); +$files = scandir('../registry/data/route6/'); $h = 0; // count up when reading new file $i = 0; foreach($files as $file) { - $handle = fopen("../dn42-registry/data/route6/$file", "r"); + $handle = fopen("../registry/data/route6/$file", "r"); while (($line = fgets($handle)) !== false) { // extract var $ta if (startsWith($line,'source')) { @@ -39,7 +39,7 @@ foreach($files as $file) $prefix = array(); $line2 = explode('6: ', $line); // validate v6 netmasks with following cmd - // cmd: ls -1 ../dn42-registry/data/route6/ | egrep -o "\b\_[0-9]+\b" | sed 's/\_//' | sort -n | uniq + // cmd: ls -1 ../registry/data/route6/ | egrep -o "\b\_[0-9]+\b" | sed 's/\_//' | sort -n | uniq preg_match('/([a-f0-9\:]{0,128})\/(32|40|4[4-9]|5[0-9]|6[0-4]|80)/', $line2[1], $prefix); $route = $prefix[0]; $mask = $prefix[2]; @@ -85,11 +85,11 @@ foreach($files as $file) $h++; } -$files = scandir('../dn42-registry/data/route/'); +$files = scandir('../registry/data/route/'); foreach($files as $file) { - $handle = fopen("../dn42-registry/data/route/$file", "r"); + $handle = fopen("../registry/data/route/$file", "r"); while (($line = fgets($handle)) !== false) { // extract var $ta if (startsWith($line,'source')) {