diff options
author | tv <tv@shackspace.de> | 2015-07-10 20:58:55 +0200 |
---|---|---|
committer | tv <tv@shackspace.de> | 2015-07-10 20:58:55 +0200 |
commit | fe7f9a1f3187d2558a9269f8b0abfb89ba5981c9 (patch) | |
tree | c28976195faf0659c06865e870cd033c136ea42b /bin | |
parent | 310c857e3bb71ac950bea6c9b94f76f1cd5dcf3d (diff) |
tv.consul: init
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/copy-secrets | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/copy-secrets b/bin/copy-secrets index 24685ede0..f40493599 100755 --- a/bin/copy-secrets +++ b/bin/copy-secrets @@ -32,6 +32,11 @@ case $(nixos-query services.ejabberd-cd.enable 2>/dev/null) in true) ejabberd_uid=$(nixos-query users.extraUsers.ejabberd.uid) esac +case $(nixos-query tv.consul.enable 2>/dev/null) in true) + consul_secret=$(nixos-query tv.consul.encrypt-file) + consul_uid=$(nixos-query users.extraUsers.consul.uid) +esac + (set -x rsync \ --rsync-path="mkdir -p \"$2\" && rsync" \ @@ -46,6 +51,8 @@ retiolum_secret=${retiolum_secret-} retiolum_uid=${retiolum_uid-} ejabberd_secret=${ejabberd_secret-} ejabberd_uid=${ejabberd_uid-} +consul_secret=${consul_secret-} +consul_uid=${consul_uid-} if test -n "\$retiolum_secret"; then chown -v "\$retiolum_uid:0" "\$retiolum_secret" @@ -55,4 +62,8 @@ if test -n "\$ejabberd_secret"; then chown -v "\$ejabberd_uid:0" "\$ejabberd_secret" fi +if test -n "\$consul_secret"; then + chown -v "\$consul_uid:0" "\$consul_secret" +fi + EOF |