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

Use replace non-standard egrep/fgrep with grep -E/-F

This commit is contained in:
Peter Dave Hello 2019-05-12 19:19:21 +08:00
parent 3de5db51e9
commit fc47a319d4
2 changed files with 2 additions and 2 deletions

@ -14,5 +14,5 @@ rotation_needed() {
}
[ "$(rotation_needed)" = true ] || exit 0
sv status dnscrypt-wrapper | egrep -q '^run:' || exit 0
sv status dnscrypt-wrapper | grep -E -q '^run:' || exit 0
sv restart dnscrypt-wrapper

@ -4,7 +4,7 @@ KEYS_DIR="/opt/dnscrypt-wrapper/etc/keys"
ZONES_DIR="/opt/unbound/etc/unbound/zones"
reserved=12582912
availableMemory=$((1024 * $( (fgrep MemAvailable /proc/meminfo || fgrep MemTotal /proc/meminfo) | sed 's/[^0-9]//g' ) ))
availableMemory=$((1024 * $( (grep -F MemAvailable /proc/meminfo || grep -F MemTotal /proc/meminfo) | sed 's/[^0-9]//g' ) ))
if [ $availableMemory -le $((reserved * 2)) ]; then
echo "Not enough memory" >&2
exit 1