cjdelisle/cjdns — pull request #205 by SashaCrofter (2013-02-20 02:40:37+00:00)
Title: Adjust startup script to not rely on pidof

Evidently, pidof is not available on certain Mac systems. This commit
switches to pgrep with arguments such that it will only match the actual
cjdns process, and not the script itself, as was problematic in certain
other implementations.

Where $CJDNS is the path to the CJDNS executable:

pgrep -d " " -f "$CJDNS"

This will output a space-delimited list of process IDs matching the path
to the CJDNS executable. This could be robustified (but perhaps broken
in future versions) by adding [angel|core] to the regex as follows.

pgrep -d " " -f "$CJDNS [angel|core]"