657657 local usage=" USAGE: wb nomad ${op} ${subop} SERVER-NAME"
658658 local name=${1:? $usage } ; shift
659659 local config_file=$( wb_nomad server config-file-path " ${name} " )
660- pgrep --delimiter ' ' --full " nomad.*${config_file} .*"
660+ # Make it Mac compatible by only using shorthand options:
661+ # `-d` instead of `--delimiter` and `-f` instead of `--full`
662+ pgrep -d ' ' -f " nomad.*${config_file} .*"
661663 # Clean up is only done by the `stop` subcommand!
662664 # No `rm "${pid_file}"` if not running.
663665 ;;
668670 local pid_file=$( wb_nomad server pid-filepath " ${name} " )
669671 local config_file=$( wb_nomad server config-file-path " ${name} " )
670672 # It's running if we haven't PROPERLY stopped it or PIDs exist!
671- test -f " ${pid_file} " || test $( pgrep --count --full " nomad.*${config_file} .*" ) -gt 0
673+ # `pgrep` piped to `wc -l` instead "--count" to make it Mac comptible
674+ # Also only shorthand options: like `-f` instead of `--full`
675+ test -f " ${pid_file} " || test $( pgrep -f " nomad.*${config_file} .*" | wc -l) -gt 0
672676 ;;
673677# ###### server -> start )#######################################################
674678 start )
879883 local usage=" USAGE: wb nomad ${op} ${subop} CLIENT-NAME"
880884 local name=${1:? $usage } ; shift
881885 local config_file=$( wb_nomad client config-file-path " ${name} " )
882- pgrep --delimiter ' ' --full " nomad.*${config_file} .*"
886+ # Make it Mac compatible by only using shorthand options:
887+ # `-d` instead of `--delimiter` and `-f` instead of `--full`
888+ pgrep -d ' ' -f " nomad.*${config_file} .*"
883889 # Clean up is only done by the `stop` subcommand!
884890 # No `rm "${pid_file}"` if not running.
885891 ;;
890896 local pid_file=$( wb_nomad client pid-filepath " ${name} " )
891897 local config_file=$( wb_nomad client config-file-path " ${name} " )
892898 # It's running if we haven't PROPERLY stopped it or PIDs exist!
893- test -f " ${pid_file} " || test $( pgrep --count --full " nomad.*${config_file} .*" ) -gt 0
899+ # `pgrep` piped to `wc -l` instead "--count" to make it Mac comptible
900+ # Also only shorthand options: like `-f` instead of `--full`
901+ test -f " ${pid_file} " || test $( pgrep -f " nomad.*${config_file} .*" | wc -l) -gt 0
894902 ;;
895903# ###### client -> start )#######################################################
896904 # Agent is started with `-network-interface lo` if not without a proper
@@ -1317,7 +1325,9 @@ EOF
13171325 pids-array )
13181326 local usage=" USAGE: wb nomad ${op} ${subop} "
13191327 local state_dir=$( wb_nomad webfs state-dir-path)
1320- pgrep --delimiter ' ' --full " webfsd.*${state_dir} " /webfsd.log
1328+ # Make it Mac compatible by only using shorthand options:
1329+ # `-d` instead of `--delimiter` and `-f` instead of `--full`
1330+ pgrep -d ' ' -f " webfsd.*${state_dir} " /webfsd.log
13211331 # Clean up is only done by the `stop` subcommand!
13221332 # No `rm "${pid_file}"` if not running.
13231333 ;;
@@ -1326,7 +1336,9 @@ EOF
13261336 local pid_file=$( wb_nomad webfs pid-filepath)
13271337 local state_dir=$( wb_nomad webfs state-dir-path)
13281338 # It's running if we haven't PROPERLY stopped it or PIDs exist!
1329- test -f " ${pid_file} " && test $( pgrep --count --full " webfsd.*${state_dir} " /webfsd.log) -gt 0
1339+ # `pgrep` piped to `wc -l` instead "--count" to make it Mac comptible
1340+ # Also only shorthand options: like `-f` instead of `--full`
1341+ test -f " ${pid_file} " && test $( pgrep -f " webfsd.*${state_dir} " /webfsd.log | wc -l) -gt 0
13301342 ;;
13311343 start )
13321344 local usage=" USAGE: wb nomad ${op} ${subop} "
0 commit comments