aboutsummaryrefslogtreecommitdiff
path: root/lib/private
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-06-01 12:22:13 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-06-01 12:22:13 +0200
commit4360f70d7a9966593d9e04043fa0a75defc094e0 (patch)
tree57e7a062754c823c9f91f13742b9b7de08937097 /lib/private
parent02d6e977e309355ae728422e26063090e8a2f193 (diff)
downloadNix-4360f70d7a9966593d9e04043fa0a75defc094e0.tar.gz
Nix-4360f70d7a9966593d9e04043fa0a75defc094e0.tar.zst
Nix-4360f70d7a9966593d9e04043fa0a75defc094e0.zip
Add phpFpm prestart script to lib
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/default.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/private/default.nix b/lib/private/default.nix
index c7d753a..b04f7b3 100644
--- a/lib/private/default.nix
+++ b/lib/private/default.nix
@@ -17,4 +17,17 @@
17 echo 17 echo
18 } 18 }
19 ''; 19 '';
20
21 phpFpmPreStart = { app, varDir, keyFiles, actions }: ''
22 if [ ! -f "${varDir}/currentWebappDir" -o \
23 ! -f "${varDir}/currentKey" -o \
24 "${app}" != "$(cat ${varDir}/currentWebappDir 2>/dev/null)" ] \
25 || ! sha512sum -c --status ${varDir}/currentKey; then
26 pushd ${app} > /dev/null
27 ${builtins.concatStringsSep "\n " actions}
28 popd > /dev/null
29 echo -n "${app}" > ${varDir}/currentWebappDir
30 sha512sum ${builtins.concatStringsSep " " keyFiles} > ${varDir}/currentKey
31 fi
32 '';
20} 33}