利用Xvfb关闭chrome的图形化输出

#!/bin/bash
. /home/fzuir/.profile

# JAVA
export JAVA_HOME=/usr/local/jdk1.7.0_75
export JRE_HOME=$JAVA_HOME/jre
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar

# 利用Xvfb关闭chrome的图形化输出
Xvfb :99 -ac >/dev/null 2>&1 &
export DISPLAY=:99

# 改变当前工作目录
cd /home/fzuir/xingye4crawl/getcookie

line=`java -jar /home/fzuir/xingye4crawl/getcookie/getCookieEpaperCs.jar`

if [[ $line =~ "login success" ]]; then
	date=$(date +"%Y%m%d %H:%M:%S");
	echo  $date : login success
	#关闭Xvfb
    ps -ef|grep Xvfb |grep -v grep|cut -c 9-15|xargs kill -9 >/dev/null 2>&1
else
	date=$(date +"%Y%m%d %H:%M:%S");
	echo  $date 
fi