summaryrefslogtreecommitdiffstats
path: root/bin/copy-secrets
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-06-24 21:02:38 +0200
committertv <tv@shackspace.de>2015-06-24 21:02:38 +0200
commit90772971a81d065028796fe2bf8a1d0ad78c06f7 (patch)
tree17125060030c5d93c124c222ff7d8edda4efc4fd /bin/copy-secrets
parent42a0fd4e6501af08ea3880ca549b18dffa26a9bd (diff)
copy-secrets: check if service is enabled
Diffstat (limited to 'bin/copy-secrets')
-rwxr-xr-xbin/copy-secrets14
1 files changed, 9 insertions, 5 deletions
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 \