File: rsync

package info (click to toggle)
openssh-known-hosts 0.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 180 kB
  • sloc: sh: 193; makefile: 7
file content (27 lines) | stat: -rwxr-xr-x 641 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

# rsync plugin
#
# ENVIRONMENT VARIABLES:
#	URL		URL to download known_hosts file from
#	SIGURL		URL of the OpenPGP signature
#	KEYRING		path to the OpenPGP keyring with certificates
#

set -e

ln -f current new || true
rsync -vt --timeout=300 "${URL}" new

if [ "${SIGURL}" ]; then
	rsync -vt --timeout=300 "${SIGURL}" new.sig
	if command -v sopv >/dev/null; then
		sopv verify new.sig "${KEYRING}" <new || exit 1
	else
		gpgv --keyring "${KEYRING}" --status-fd 2 new.sig new || exit 1
	fi
	# return 1 because it's not clear what other codes may be safe to
	# use that do not overlap with codes from rsync.
fi	

# vim:set ft=sh: