aboutsummaryrefslogtreecommitdiff
path: root/keys
diff options
context:
space:
mode:
Diffstat (limited to 'keys')
-rwxr-xr-xkeys/auth.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/keys/auth.sh b/keys/auth.sh
new file mode 100755
index 0000000..15313a0
--- /dev/null
+++ b/keys/auth.sh
@@ -0,0 +1,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"