Created
April 26, 2013 10:13
-
-
Save dkushnikov/5466280 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
## | |
# start|stop|restart selenium hub | |
# | |
# USAGE: | |
# ./selenium-hub.sh start|stop|restart | |
# | |
RUNTIME="/opt/selenium" | |
SELENIUM_CMD="java -jar ${RUNTIME}/lib/selenium-server-standalone*.jar -role hub -port 4444" | |
case $1 in | |
"start" ) | |
echo "start selenium hub" | |
nohup ${SELENIUM_CMD} > /tmp/nohup.out 2> /tmp/nohup.out & | |
;; | |
"stop" ) | |
echo "stop selenium hub" | |
kill `ps aux | grep "java -jar ${RUNTIME}/lib/selenium-server-standalone" | grep -v grep | awk '{print $2}'` > /dev/null | |
;; | |
"restart" ) | |
echo "restart selenium hub" | |
kill `ps aux | grep "java -jar ${RUNTIME}/lib/selenium-server-standalone" | grep -v grep | awk '{print $2}'` > /dev/null | |
nohup ${SELENIUM_CMD} > /tmp/nohup.out 2> /tmp/nohup.out & | |
;; | |
*) | |
echo "need start|stop|restart" | |
exit 1 | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment