aboutsummaryrefslogtreecommitdiff
path: root/keys/auth.sh
blob: 15313a0c77a1fc2d3f0a20f04c78a78e1ef61062 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
_timeout=5
_url="https://www.rygel.us/etc/keys/personal"
cache="/etc/ssh/keys"

_temp="$(mktemp)"

if curl \
	--connect-timeout $_timeout \
	"$_url" > "$_temp" 2>/dev/null
then
	cat "$_temp" | tee $cache
else
	cat $cache
fi

rm "$_temp"