From 8f32f842b33bdc6617b41dc9f18b222fd3013e21 Mon Sep 17 00:00:00 2001 From: Timo Weingärtner Date: Sat, 25 Feb 2012 21:08:57 +0100 Subject: Imported Debian version 0.1 --- plugins/curl | 13 +++++++++++++ plugins/psql | 25 +++++++++++++++++++++++++ plugins/rsync | 14 ++++++++++++++ plugins/symlink | 14 ++++++++++++++ 4 files changed, 66 insertions(+) create mode 100755 plugins/curl create mode 100755 plugins/psql create mode 100755 plugins/rsync create mode 100755 plugins/symlink (limited to 'plugins') diff --git a/plugins/curl b/plugins/curl new file mode 100755 index 0000000..8e658cc --- /dev/null +++ b/plugins/curl @@ -0,0 +1,13 @@ +#!/bin/dash + +# curl plugin +# +# ENVIRONMENT VARIABLES: +# URL URL to download known_hosts file from +# + +set -e + +curl -Rz "./current" -m 300 -o new "${URL}" + +# vim:set ft=sh: 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: diff --git a/plugins/rsync b/plugins/rsync new file mode 100755 index 0000000..17a1e54 --- /dev/null +++ b/plugins/rsync @@ -0,0 +1,14 @@ +#!/bin/dash + +# rsync plugin +# +# ENVIRONMENT VARIABLES: +# URL URL to download known_hosts file from +# + +set -e + +ln -f current new || true +rsync -vt --timeout=300 "${URL}" new + +# vim:set ft=sh: diff --git a/plugins/symlink b/plugins/symlink new file mode 100755 index 0000000..159e0e7 --- /dev/null +++ b/plugins/symlink @@ -0,0 +1,14 @@ +#!/bin/dash + +# symlink plugin +# +# ENVIRONMENT VARIABLES: +# LINKDEST known_hosts file to link to +# + +set -e + +[ -f "${LINKDEST}" ] && [ -r "${LINKDEST}" ] +ln -sf "${LINKDEST}" new + +# vim:set ft=sh: -- cgit v1.2.3