summaryrefslogtreecommitdiff
path: root/plugins/psql
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/psql')
-rwxr-xr-xplugins/psql25
1 files changed, 25 insertions, 0 deletions
diff --git a/plugins/psql b/plugins/psql
new file mode 100755
index 0000000..d1009ef
--- /dev/null
+++ b/plugins/psql
@@ -0,0 +1,25 @@
+#!/bin/dash
+
+# psql plugin
+#
+# uses psql to download a table (or view) of the form:
+# CREATE TABLE known_hosts (
+# namelist text, # comma seperated
+# type text,
+# key text
+# );
+#
+# ENVIRONMENT VARIABLES:
+# TABLE table to download
+# used by psql:
+# PGCLUSTER see pg_wrapper(1)
+# PGDATABASE see psql(1)
+# PGUSER ..
+# PGPASSFILE ..
+#
+
+set -e
+
+psql -F ' ' -Atc "SELECT * FROM ${TABLE}" > new
+
+# vim:set ft=sh: