Skip to content

Instantly share code, notes, and snippets.

@kronda
Created October 13, 2012 02:51
Show Gist options
  • Save kronda/3883026 to your computer and use it in GitHub Desktop.
Save kronda/3883026 to your computer and use it in GitHub Desktop.
Bash file for starting and stopping Selenium server
#!/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