blob: 59646138997afe74df562a8880bc7fef56ec47d9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/bin/dash
# curl plugin
#
# ENVIRONMENT VARIABLES:
# URL URL to download known_hosts file from
# SIGURL URL of the GnuPG signature
# KEYRING path to the keyring for use by gpgv
#
set -e
if [ "${SIGURL}" ]; then
curl -Rz "./current" -m 300 -o new.sig "${SIGURL}" -o new "${URL}"
[ -e new ] || exit 0
gpgv --keyring "${KEYRING}" --status-fd 2 new.sig || exit 1
# return 1 because it's not clear what other codes may used
else
curl -Rz "./current" -m 300 -o new "${URL}"
fi
# vim:set ft=sh:
|