Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
out=$(echo dump | nc ::1 33123 | grep "add neighbour" 2>/dev/null) && [ -n "$out" ]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
out=$(echo dump | nc ::1 33123 | grep "add neighbour" 2>/dev/null) && [ -n "$out" ]
echo dump | nc ::1 33123 | grep -qF 'add neighbour'

As we're only interested whether there is matching output or not, grep -q should be used. Adding -F makes it more efficient, as it doesn't interpret the pattern as a regex.

@AiyionPrime AiyionPrime Jan 14, 2022

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still lack a node/network to test this on;
One possible issue I see are possible error-messages of nc.
I'll apply the commit in a moment. Afterwords this can be marked as blocked by #2353 .