Upgrade p4dtate.sh, p4pstate.sh, and p4brokerstate.sh to be SDP-aware.
Update the stock p4dstate.sh (and related p4pstate.sh and p4brokerstate.sh) to be
fully SDP-aware without making them SDP-dependent. That is, if operating in an
SDP environment with a defined structure and shell environment, take advantage of
that to avoid the need to define things like placement of p4d/p4p/p4broker binaries.
In an non-SDP environment, they will just work.
Improvements planned to bring it up to SDP standards:
* Add user documentation (-h and -man options), including guidance on when to run it,
and where to send logs (e.g. to support-helix-core@perforce.com).
* Make it the script never needs to be edited, e.g. using command line parameters and/or a configuration file.
* Improve logging mechanism.
* Make it reliable – the script should never hang, even if the p4d commands it tries to
run hang. (Use 'timeout' utility to avoid hangs).
Use bash, not sh.
Pass ShellCheck (lint for bash) compliance.
Add a '-update' option so the script can try to update itself with the latest version, e.g.
via curl from the Perforce FTP server (will only work with external network connectivity; this
limitation to be documented and also with an appropriate error message).
There will be a copy of the new versions p4 p4dstate.sh, p4brokerstate.sh, and p4pstate.sh distributed
with the SDP.