cjdelisle/cjdns — pull request #138 by sebnow (2012-11-11 13:41:34+00:00)
Title: cjdns.sh: Add status command

The check command is the closest available to check whether cjdns is
running. However, it has the side effect of starting cjdns if it is not
running.

Add the `status` command to report whether cjdns is running. This is
similar to a lot of init.d scripts for services. If cjdns is running, an
exit code of 0 will be returned. Otherwise an exit code of 1 is
returned.

$ ./scripts/cjdns.sh status
* cjdns is running

The `check` command could be refactored to use "status", however I don't know if there's a specific reason for using `ps | grep` instead of `pidof`. It seems the grep is more specific (looks for `cjdns core`).