diff options
author | Jesse Luehrs <doy@tozt.net> | 2018-10-19 21:43:03 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2018-10-19 21:43:03 -0400 |
commit | de4591de61942b3008e07a44344398bffc876cf2 (patch) | |
tree | 1ca646bc73778ca5d155b3ab2b8ccaecb028cdec /bin | |
parent | 89c0cc84be250ba8fe5722baa35293c70c98f2a0 (diff) | |
download | puppet-tozt-de4591de61942b3008e07a44344398bffc876cf2.tar.gz puppet-tozt-de4591de61942b3008e07a44344398bffc876cf2.zip |
make bin/secrets support multiple hosts
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/secrets | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/bin/secrets b/bin/secrets index 7aef22c..e25454b 100755 --- a/bin/secrets +++ b/bin/secrets @@ -30,6 +30,14 @@ cmd_close() { } cmd_sync() { + host="${2:-tozt}" + if [ "${host}" = "tozt" ]; then + hostname=tozt.net + else + echo "unknown host ${host}" >&2 + exit 1 + fi + if mounted && opened; then was_opened=1 else @@ -37,10 +45,9 @@ cmd_sync() { was_opened="" fi - host="${2:-tozt.net}" rsync -avz --delete \ - /mnt/puppet/. \ - root@"$host":/usr/local/share/puppet-tozt/modules/secret/files + /mnt/puppet/"$host"/. \ + root@"$hostname":/usr/local/share/puppet-tozt/modules/secret/files if [ -z "$was_opened" ]; then cmd_close |