echo
}
'';
+
+ phpFpmPreStart = { app, varDir, keyFiles, actions }: ''
+ if [ ! -f "${varDir}/currentWebappDir" -o \
+ ! -f "${varDir}/currentKey" -o \
+ "${app}" != "$(cat ${varDir}/currentWebappDir 2>/dev/null)" ] \
+ || ! sha512sum -c --status ${varDir}/currentKey; then
+ pushd ${app} > /dev/null
+ ${builtins.concatStringsSep "\n " actions}
+ popd > /dev/null
+ echo -n "${app}" > ${varDir}/currentWebappDir
+ sha512sum ${builtins.concatStringsSep " " keyFiles} > ${varDir}/currentKey
+ fi
+ '';
}