diff options
author | makefu <github@syntax-fehler.de> | 2015-11-06 22:23:46 +0100 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2015-11-06 22:23:46 +0100 |
commit | 736e1426d5a7ec76d0987840552d56c6b4f0248e (patch) | |
tree | 944c5595dfbb2c66dfe934d48cc8349522c91aa8 /makefu/2configs/nginx/euer.wiki.nix | |
parent | 2dcb2918d1cd159d9282096ef3b5cecc4239bfbc (diff) | |
parent | 12597b1febb0bc47cf98529a12e5fc6af1d8f5a4 (diff) |
Merge branch 'master' of pnp:stockholm
Diffstat (limited to 'makefu/2configs/nginx/euer.wiki.nix')
-rw-r--r-- | makefu/2configs/nginx/euer.wiki.nix | 13 |
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"; |