aboutsummaryrefslogtreecommitdiff
path: root/rp/utils/table.awk
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2014-04-10 22:56:47 +0000
committerRob Austein <sra@hactrn.net>2014-04-10 22:56:47 +0000
commit45b95aaadc861b0e682373164fe18fa0c5ed2b2e (patch)
tree6e415c4dd6b78e84a58ae0038ab9847fb69feafc /rp/utils/table.awk
parent5e0d1807ca7b049bde262a529443924adfd903e6 (diff)
parentb7459d825cfadb9db265ed1b3bd0c10682464767 (diff)
Merge tk685 branch back to trunk. This completes the move of the rpki
libraries and rpki.POW module from the rpki-ca package to the rpki-rp package. Closes #685, closes #633. svn path=/trunk/; revision=5784
Diffstat (limited to 'rp/utils/table.awk')
-rw-r--r--rp/utils/table.awk35
1 files changed, 35 insertions, 0 deletions
diff --git a/rp/utils/table.awk b/rp/utils/table.awk
new file mode 100644
index 00000000..d8627f67
--- /dev/null
+++ b/rp/utils/table.awk
@@ -0,0 +1,35 @@
+#!/usr/bin/awk -f
+# $Id$
+#
+# Reformat uri.c's output in a way that's more useful
+# for some kinds of scripting. Perhaps this functionality should be
+# part of uri.c itself, but for now this script will do.
+
+BEGIN {
+ cmd = "find /var/rcynic/data/unauthenticated -type f -name '*.cer' -print0 | xargs -0 ./uri -d";
+ while ((cmd | getline) == 1) {
+ if ($1 == "File") {
+ if (f)
+ print f, u, a, s, c;
+ a = s = c = "-";
+ f = $2;
+ sub("/var/rcynic/data/unauthenticated/","rsync://");
+ u = $2;
+ continue;
+ }
+ if ($1 == "SIA:") {
+ s = $2;
+ continue;
+ }
+ if ($1 == "AIA:") {
+ a = $2;
+ continue;
+ }
+ if ($1 == "CRL:") {
+ c = $2;
+ continue;
+ }
+ }
+ if (f != "-")
+ print f, u, a, s, c;
+}