Created
April 23, 2015 19:02
-
-
Save nuxlli/cf518b553792b843cd54 to your computer and use it in GitHub Desktop.
Run azk agent in a script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "" > /tmp/azk-agent-start.log | |
./bin/azk agent start --no-daemon > /tmp/azk-agent-start.log 2>&1 & | |
AGENT_PID="$!" | |
tail -f /tmp/azk-agent-start.log & | |
TAIL_PID="$!" | |
echo "PIDS - agent: ${AGENT_PID}, tail: ${TAIL_PID}"; | |
until tail -1 /tmp/azk-agent-start.log | grep -q 'Agent has been successfully started.'; do | |
sleep 2; | |
kill -0 ${AGENT_PID} || exit 1; | |
done | |
kill -9 $TAIL_PID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment