Skip to content

Instantly share code, notes, and snippets.

@thewoolleyman
Created December 6, 2010 16:19
Show Gist options
  • Save thewoolleyman/730511 to your computer and use it in GitHub Desktop.
Save thewoolleyman/730511 to your computer and use it in GitHub Desktop.
Start selenium-rc if needed
#!/usr/bin/env bash
export SELENIUM_SERVER_PORT=4444
process_id=$(lsof -i tcp:$SELENIUM_SERVER_PORT -Fp|tr -d p)
if [ $process_id ] ; then
echo "Selenium server is already running"
else
selenium-rc &
echo "New Selenium server started"
fi
# now run your command which requires local selenium rc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment