from subprocess import Popen
import sys
import urllib2

html=''
#-- Check to see if SeGrid Hub is available
try:
        response=urllib2.urlopen('http://localhost:4200/grid/console')
        html=response.read()
        exit
except urllib2.URLError:
        pass

#-- If SeGrid Hub available, move on, if not, start it
if 'Grid Console' in html:
        exit
else:
        Popen('java -Xmx512m -jar /home/ubuntu/selenium-server.jar -role hub -port 4200 -DPOOL_MAX=256 -timeout 300 -browserTimeout 60 -cleanUpCycle 5000&',shell=True)

@@ -383,17 +383,8 @@
 ava 
--Xmx512m 
 -jar
@@ -466,9 +466,11 @@
 out 
-3
+150
 00 -
@@ -501,17 +501,17 @@
 UpCycle 
-5
+1
 000&',sh

Update SeGrid-Hub.py