summaryrefslogtreecommitdiff
path: root/plugins/psql
blob: 2e194f689a2d591bfb81cfd81910a2c0962f48df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

# psql plugin
#
# uses psql to download a TABLE (or VIEW) of the form:
# CREATE TABLE known_hosts (
#	namelist	text, # comma separated
#	type		text,
#	key		text
# );
# alternatively only one column with spaces between those three
#
# ENVIRONMENT VARIABLES:
#	TABLE		table to download
# used by psql:
#	PG*		see psql(1)
#

set -e

psql -F ' ' -Atc "SELECT * FROM ${TABLE}" > new

# vim:set ft=sh: