mirror of
https://github.com/dnscrypt/dnscrypt-server-docker
synced 2024-11-26 06:13:49 +01:00
Remoe unnecessary $
on arithmetic variables in shell script
This commit is contained in:
parent
3ea7dd925c
commit
96b9dc9b32
10
unbound.sh
10
unbound.sh
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user