diff options
-rwxr-xr-x | bin/copy-secrets | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/bin/copy-secrets b/bin/copy-secrets index d155399e9..b6b93b616 100755 --- a/bin/copy-secrets +++ b/bin/copy-secrets @@ -25,6 +25,18 @@ rsync -cz --chown=0:0 -vr "$secrets_rsync/" "$target:/" ssh "$target" -T <<EOF set -euf -! test -f $retiolum_secret || chown -v $retiolum_uid:0 $retiolum_secret -! test -f $ejabberd_secret || chown -v $ejabberd_uid:0 $ejabberd_secret + +retiolum_secret=${retiolum_secret-} +retiolum_uid=${retiolum_uid-} +ejabberd_secret=${ejabberd_secret-} +ejabberd_uid=${ejabberd_uid-} + +if test -n "\$retiolum_secret"; then + chown -v "\$retiolum_uid:0" "\$retiolum_secret" +fi + +if test -n "\$ejabberd_secret"; then + chown -v "\$ejabberd_uid:0" "\$ejabberd_secret" +fi + EOF |