From fc47a319d493e37cf1c387c86c1632beff00df41 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Sun, 12 May 2019 19:19:21 +0800 Subject: [PATCH] Use replace non-standard egrep/fgrep with grep `-E/-F` --- key-rotation.sh | 2 +- unbound.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/key-rotation.sh b/key-rotation.sh index 71ffba5..bfe7285 100755 --- a/key-rotation.sh +++ b/key-rotation.sh @@ -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 diff --git a/unbound.sh b/unbound.sh index c793094..c44c3a9 100755 --- a/unbound.sh +++ b/unbound.sh @@ -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