From de4591de61942b3008e07a44344398bffc876cf2 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 19 Oct 2018 21:43:03 -0400 Subject: make bin/secrets support multiple hosts --- bin/secrets | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'bin') 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 -- cgit v1.2.3-54-g00ecf