summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/nginx/euer.wiki.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2015-11-05 12:31:09 +0100
committermakefu <github@syntax-fehler.de>2015-11-05 12:31:09 +0100
commitf02a96efb22d10b529483a7e14301cd46b58a40d (patch)
treec435ca9a86b86589e4e4a178e742a2d9eefde3a5 /makefu/2configs/nginx/euer.wiki.nix
parent699822f572162e4ddcc0fa7f5690142cba1c8c5d (diff)
m 2 nginx/euer*: prepare folders if they do not exist
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";