1
1
mirror of https://github.com/dnscrypt/dnscrypt-server-docker synced 2024-11-22 19:42:03 +01:00

Remoe unnecessary $ on arithmetic variables in shell script

This commit is contained in:
Peter Dave Hello 2019-05-12 19:13:06 +08:00
parent 3ea7dd925c
commit 96b9dc9b32

@ -5,16 +5,16 @@ ZONES_DIR="/opt/unbound/etc/unbound/zones"
reserved=12582912
availableMemory=$((1024 * $( (fgrep MemAvailable /proc/meminfo || fgrep MemTotal /proc/meminfo) | sed 's/[^0-9]//g' ) ))
if [ $availableMemory -le $(($reserved * 2)) ]; then
if [ $availableMemory -le $((reserved * 2)) ]; then
echo "Not enough memory" >&2
exit 1
fi
availableMemory=$(($availableMemory - $reserved))
msg_cache_size=$(($availableMemory / 3))
rr_cache_size=$(($availableMemory / 3))
availableMemory=$((availableMemory - reserved))
msg_cache_size=$((availableMemory / 3))
rr_cache_size=$((availableMemory / 3))
nproc=$(nproc)
if [ "$nproc" -gt 1 ]; then
threads=$(($nproc - 1))
threads=$((nproc - 1))
else
threads=1
fi