#!/usr/local/bin/python2.5

import os

stopped = False

# Stop Apache if it's running.
for line in os.popen('ps -o pid,command -u rodericj'):
    if '/home/rodericj/webapps/force_quared/apache2/conf/httpd.conf' in line:
        stopped = True
        os.system('kill %s' % line.split()[0])

if not stopped:
    print "Apache isn't running."
