summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/nginx/euer.wiki.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2015-11-06 22:23:46 +0100
committermakefu <github@syntax-fehler.de>2015-11-06 22:23:46 +0100
commit736e1426d5a7ec76d0987840552d56c6b4f0248e (patch)
tree944c5595dfbb2c66dfe934d48cc8349522c91aa8 /makefu/2configs/nginx/euer.wiki.nix
parent2dcb2918d1cd159d9282096ef3b5cecc4239bfbc (diff)
parent12597b1febb0bc47cf98529a12e5fc6af1d8f5a4 (diff)
Merge branch 'master' of pnp:stockholm
Diffstat (limited to 'makefu/2configs/nginx/euer.wiki.nix')
-rw-r--r--makefu/2configs/nginx/euer.wiki.nix13
1 files changed, 8 insertions, 5 deletions
diff --git a/makefu/2configs/nginx/euer.wiki.nix b/makefu/2configs/nginx/euer.wiki.nix
index fbcfe2047..2b5fa6ead 100644
--- a/makefu/2configs/nginx/euer.wiki.nix
+++ b/makefu/2configs/nginx/euer.wiki.nix
@@ -51,18 +51,21 @@ in {
serviceConfig = {
ExecStart = pkgs.writeScript "prepare-tw-service" ''
#!/bin/sh
- mkdir -p "${wiki-dir}" "${backup-dir}"
+ if ! test -d "${base-dir}" ;then
+ mkdir -p "${wiki-dir}" "${backup-dir}"
- # write the base configuration
- cat > "${base-cfg}" <<EOF
+ # write the base configuration
+ cat > "${base-cfg}" <<EOF
[users]
$(cat "${tw-pass-file}")
[directories]
backupdir = ${backup-dir}
savedir = ${wiki-dir}
EOF
- chown -R ${user}:${group} "${base-dir}"
- chmod 700 -R "${base-dir}"
+
+ chown -R ${user}:${group} "${base-dir}"
+ chmod 700 -R "${base-dir}"
+ fi
'';
Type = "oneshot";
RemainAfterExit = "yes";