gluon-status-page-api: limit uhttp max_requests to 16 on devices with less than 48MB RAM (part 1/2 for fixing #1032)

This commit is contained in:
Christof Schulze 2017-02-15 18:33:00 +01:00
parent 568ba483bb
commit b3bc419578

View File

@ -8,6 +8,15 @@ uci -q batch <<-EOF
delete uhttpd.main.listen_https
set uhttpd.main.home=/lib/gluon/status-page/www
set uhttpd.main.max_requests=32
EOF
RAM=$(grep MemTotal /proc/meminfo |awk '{print $2}')
if [ $RAM -lt $((48*1024)) ]; then
echo "set uhttpd.main.max_requests=16"
else
echo "set uhttpd.main.max_requests=32"
fi |uci -q batch
if [ -x /etc/init.d/rpcd ]; then
/etc/init.d/rpcd disable
fi