summaryrefslogtreecommitdiff
path: root/plugins/psql
blob: a7c0a72ad5d20ef951adb890ebe2f1a47bf14543 (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 seperated
#	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: