From 90772971a81d065028796fe2bf8a1d0ad78c06f7 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 24 Jun 2015 21:02:38 +0200 Subject: copy-secrets: check if service is enabled --- bin/copy-secrets | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'bin/copy-secrets') diff --git a/bin/copy-secrets b/bin/copy-secrets index 74b9301a6..24685ede0 100755 --- a/bin/copy-secrets +++ b/bin/copy-secrets @@ -22,11 +22,15 @@ NIX_PATH=$NIX_PATH:nixos-config=$PWD/modules/$system_name NIX_PATH=$NIX_PATH:secrets=$PWD/secrets/$system_name/nix export NIX_PATH -retiolum_secret=$(nixos-query tv.retiolum.privateKeyFile) -retiolum_uid=$(nixos-query users.extraUsers.retiolum-tinc.uid) - -ejabberd_secret=$(nixos-query services.ejabberd-cd.certFile) -ejabberd_uid=$(nixos-query users.extraUsers.ejabberd.uid) +case $(nixos-query tv.retiolum.enable 2>/dev/null) in true) + retiolum_secret=$(nixos-query tv.retiolum.privateKeyFile) + retiolum_uid=$(nixos-query users.extraUsers.retiolum-tinc.uid) +esac + +case $(nixos-query services.ejabberd-cd.enable 2>/dev/null) in true) + ejabberd_secret=$(nixos-query services.ejabberd-cd.certFile) + ejabberd_uid=$(nixos-query users.extraUsers.ejabberd.uid) +esac (set -x rsync \ -- cgit v1.2.3