#!/bin/bash . /etc/profile VIRTUAL_DISPLAY=":50" Xvfb_parm="$VIRTUAL_DISPLAY -screen 0 800x600x16" pid=`ps -eaf | grep Xvfb | grep $VIRTUAL_DISPLAY | awk '{print $2}'` if [ $pid ] then kill -9 $pid # echo $pid fi rm -f /tmp/.X${VIRTUAL_DISPLAY}-lock