Last active
December 16, 2015 16:49
-
-
Save dkushnikov/5466256 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 server | |
# | |
# USAGE: | |
# ./selenium-server.sh start|stop|restart | |
# | |
RUNTIME="/opt/selenium" | |
SELENIUM_CMD="java -jar ${RUNTIME}/lib/selenium-server-standalone*.jar -multiwindow -port 4444" | |
case $1 in | |
"start" ) | |
echo "start selenium server" | |
nohup ${SELENIUM_CMD} > /tmp/nohup.out 2> /tmp/nohup.out & | |
;; | |
"stop" ) | |
echo "stop selenium server" | |
kill `ps aux | grep "java -jar ${RUNTIME}/lib/selenium-server-standalone" | grep -v grep | awk '{print $2}'` > /dev/null | |
;; | |
"restart" ) | |
echo "restart selenium server" | |
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