From b420358cc863ada51c46764747ae8d3711bee4ae Mon Sep 17 00:00:00 2001
From: inso <insomniak.fr@gmail.com>
Date: Sat, 24 Feb 2018 17:47:17 +0000
Subject: [PATCH] Update xfvb.sh

---
 xfvb.sh | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/xfvb.sh b/xfvb.sh
index a2984f9..6b3523e 100644
--- a/xfvb.sh
+++ b/xfvb.sh
@@ -1 +1,23 @@
-xvfb :99 -screen 0 1280x1024x24 -nolisten tcp &
\ No newline at end of file
+XVFB=/usr/bin/Xvfb
+XVFBARGS="$DISPLAY -ac -screen 0 1280x1024x24 +extension RANDR"
+PIDFILE=/var/xvfb_${DISPLAY:1}.pid
+case "$1" in
+  start)
+    echo -n "Starting virtual X frame buffer: Xvfb"
+    /sbin/start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS
+    echo "."
+    ;;
+  stop)
+    echo -n "Stopping virtual X frame buffer: Xvfb"
+    /sbin/start-stop-daemon --stop --quiet --pidfile $PIDFILE
+    echo "."
+    ;;
+  restart)
+    $0 stop
+    $0 start
+    ;;
+  *)
+  echo "Usage: /etc/init.d/xvfb {start|stop|restart}"
+  exit 1
+esac
+exit 0
-- 
GitLab