diff options
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"; |