fix sed command to do an inplace update of nginx.conf

This commit is contained in:
sadnub
2022-08-17 11:52:54 -04:00
committed by GitHub
parent 00d8b8cd61
commit 7ac9af1cc1

View File

@@ -35,8 +35,7 @@ nginxdefaultconf='/etc/nginx/nginx.conf'
# increase default nginx worker connections
/bin/bash -c "sed -i 's/worker_connections.*/worker_connections ${WORKER_CONNECTIONS};/g' $nginxdefaultconf"
sed -e '/worker_processes.*/a\' -e 'worker_rlimit_nofile 1000000' "${nginxdefaultconf}"
grep -q -e 'worker_rlimit_nofile' "${nginxdefaultconf}" || sed -e '/worker_processes.*/a\' -e 'worker_rlimit_nofile 1000000' "${nginxdefaultconf}"
grep -q -e 'worker_rlimit_nofile' "${nginxdefaultconf}" || sed -i -e '/worker_processes.*/a\' -e 'worker_rlimit_nofile 1000000;' "${nginxdefaultconf}"
if [[ $DEV -eq 1 ]]; then
API_NGINX="