#! /bin/bash ################### # Start VNC server ################### . /etc/rc.d/functions VNC_CMD="x11vnc -display :0 -bg -nopw -localhost -ncache 10 -forever -o /var/log/x11vnc.log" case $1 in start) stat_busy "Starting X11VNC" $VNC_CMD &> /dev/null if [ $? -gt 0 ] ; then stat_fail else add_daemon x11vnc stat_done fi ;; restart) $0 stop sleep 1 $0 start ;; stop) stat_busy "Stopping X11VNC" killall x11vnc if [ $? -gt 0 ] ; then stat_fail else rm_daemon x11vnc stat_done fi ;; *) echo "Usage: /etc/rc.d/x11vnc {start|restart|stop}" ;; esac exit 0