Created
October 13, 2012 02:51
-
-
Save kronda/3883026 to your computer and use it in GitHub Desktop.
Bash file for starting and stopping Selenium server
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 | |
SELENIUM=/usr/local/bin/selenium-server.jar | |
LOG=/var/log/selenium.log | |
PIDFILE=/opt/bin/selenium.pid | |
ARG=$1 | |
if [ ${#ARG} -lt 1 ] | |
then echo "\nUSAGE: $0 {start|stop}\n" | |
exit 1 | |
fi | |
if [ $ARG = stop ] | |
then SELPID=`cat $PIDFILE` && kill $SELPID | |
echo "Stopping Selenium server!" | |
exit 0 | |
fi | |
if [ $ARG = start ] | |
then java -jar $SELENIUM > $LOG & | |
echo "Starting Selenium server!" | |
echo $! > $PIDFILE | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment