make grep usage POSIX compliant

use grep -E instead of egrep
check for space or end of line instead of GNU-specific word boundary

This fixes #345
This commit is contained in:
Ethan Sommer 2020-01-02 09:28:25 -05:00 committed by William Hubbs
parent 12e147a107
commit a7e7fd2b37

View File

@ -20,7 +20,7 @@ service_present()
# succeed if $RC_SYS empty, can't check further, assume script will run
[ -z "$RC_SYS" ] && return 0
# fail if file contains "-$RC_SYS", because then it won't run
egrep -qi "^[[:space:]]*keyword[[:space:]].*-$RC_SYS\>" "$p" && return 1
grep -Eqi "^[[:space:]]*keyword[[:space:]].*-$RC_SYS([[:space:]]|$)" "$p" && return 1
# succeed otherwise
return 0
}