diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2018-12-02 13:48:10 -0500 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2018-12-02 13:48:10 -0500 |
| commit | 3c5613c5dd57ac7748d9e90288e4bc7b45a7f55d (patch) | |
| tree | 88374a313f85b0035dc81764df5b255784a5e515 | |
| parent | 5db209214c5603a18f450897516fe8d13c3ccbee (diff) | |
| download | dotfiles-3c5613c5dd57ac7748d9e90288e4bc7b45a7f55d.tar.gz dotfiles-3c5613c5dd57ac7748d9e90288e4bc7b45a7f55d.tar.xz | |
Update script to go in the crontab of servers I don't care too much about but want to maintain access to
| -rw-r--r-- | keys/update.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/keys/update.sh b/keys/update.sh new file mode 100644 index 0000000..66d0e6a --- /dev/null +++ b/keys/update.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# Easy script to throw in the crontab of a system to update SSH keys from +# my personal server via HTTPs. This implies that you trust all of the CAs +# on your system.... It's up to you whether you are going to risk that. +set -e +_timeout=5 +_url="https://www.rygel.us/etc/keys/personal" +keys="$HOME/.ssh/authorized_keys" + +_temp="$(mktemp)" + +if curl \ + --connect-timeout $_timeout \ + "$_url" > "$_temp" 2>/dev/null +then + cp "$_temp" "$keys" + chmod 600 "$keys" +fi + +rm "$_temp" |
