#!/usr/bin/bash

ENABLED=yes
[[ ${ENABLED} == yes ]] || exit 0

DEBUGMODE=no
. /usr/lib/ublinux/functions
debug_mode "$0" "$@"

. /etc/ublinux/config

    if [[ -n ${X11VNC_PASSWORD} ]]; then
	[[ -d /root/.vnc ]] || mkdir -p /root/.vnc
	/usr/bin/x11vnc -storepasswd ${X11VNC_PASSWORD} /root/.vnc/passwd
	chmod 600 /root/.vnc/passwd
    
	# Show obscured password
        #/usr/bin/x11vnc -showrfbauth /root/.vnc/passwd
    fi
