/ Published in: Bash
Use the -z option to netcat so you don\\\\'t have to bother with piping input into the port once opened. All you want to know is if the service is up!\r\n\r\nThen, if you are running this checker inside of Hudson, you need to set the BUILDID env var to something abitrary like BUILDID=dontKill\r\n\r\nKludgy, but it works
Expand |
Embed | Plain Text
# attempt to start apache only if it's not already running on port 80 nc -vz localhost 80 || apachectl start # for hudson BUILD_ID=allow_to_run_as_daemon nc -vz localhost 80 || apachectl start
You need to login to post a comment.
