You are welcome, Dave.
Since group messages don't allow attachments, here's the two lines that are changed in the echo_inbound script to enable regular expressions in
node_deny and node_allow files.
For node_deny, change:
if [ `grep -x "$ESCSTR" "$ECHO_CUSTOM/node_deny"` ]; then
-to-
if [ `echo "${ESCSTR}" | egrep -x -i -f "$ECHO_CUSTOM/node_deny"` ]; then
For node_allow, change:
if [ `grep -x "$ESCSTR" "$ECHO_CUSTOM/node_allow"` ]; then
-to-
if [ `echo "${ESCSTR}" | egrep -x -i -f "$ECHO_CUSTOM/node_allow"` ];
then
grep notes:
- The "-x" switch selects only those matches that exactly match the
whole line. This is a minor edit I forgot to include in the modified file I
sent to Dave. It ensures a line containing WD5M does not also match WD5MA.
This also means regex values should include syntax to match the value
completely. e.g. use "^AA[0-9].*" instead of just "^AA[0-9]".
- The "-i" switch says the letter case is to be ignored.
- The "-f" switch says matching (regex) patterns are in the file
specified.
This modification will also work the same with preexisting call sign values
in node_allow or node_deny. Tutorials for regular expression (regex) syntax
are available online. Use your favorite search engine. regex syntax can
allow simple or complex value ranges to be matched. For example, the regex value "^WD5M-*[LR]*" will match WD5M or WD5M-R or WD5M-L. One can manually
test these values using the command line. For example:
echo "WD5M-L" | egrep -x -i -f "$ECHO_CUSTOM/node_deny"
If "WD5M-L" is displayed as a result, then it matched a line in the
node_deny file.
Any match in node_allow will override a match in node_deny or type_deny, as echo_inbound is currently coded. This allows one to block a type or range
of values, and then make exceptions in node_allow. Be sure to test expected values completely to be sure it does what you expect, especially with regex values.
Regards,
David M.
WD5M
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#249):
https://groups.io/g/echoirlp/message/249
Mute This Topic:
https://groups.io/mt/89579384/3738798
Group Owner:
echoirlp+owner@groups.io
Unsubscribe:
https://groups.io/g/echoirlp/leave/6882233/3738798/232177168/xyzzy
[
vk_echoirlp@freeway.apana.org.au]
-=-=-=-=-=-=-=-=-=-=-=-
--- SBBSecho 3.10-Linux
* Origin: Freeway BBS Bendigo,Australia freeway.apana.org.au (432:1/101)