37 |
local CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/99-vnc.conf" |
local CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/99-vnc.conf" |
38 |
clearconfig |
clearconfig |
39 |
addconfig ' Option "SecurityTypes" "VncAuth"' |
addconfig ' Option "SecurityTypes" "VncAuth"' |
40 |
addconfig ' Option "UserPasswdVerifier" "VncAuth"' |
addconfig ' Option "UserPasswdVerifier" "VncAuth"' |
41 |
addconfig ' Option "PasswordFile" "/root/.vnc/passwd"' |
addconfig ' Option "PasswordFile" "/root/.vnc/passwd"' |
42 |
|
|
43 |
# requires graphic! |
# requires graphic! |
44 |
helper_graphic_rebuild_xorg_conf_d |
helper_graphic_rebuild_xorg_conf_d |
62 |
|
|
63 |
get_vnc_service() |
get_vnc_service() |
64 |
{ |
{ |
65 |
if [ -f ${MROOT}/etc/X11/xorg.conf.d/25-module.conf ] |
if [ -f ${MROOT}@@SYSCONFDIR@@/X11/xorg.conf.d/25-module.conf ] |
66 |
then |
then |
67 |
if [[ -n $(grep 'Load.*vnc' ${MROOT}/etc/X11/xorg.conf.d/25-module.conf) ]] |
if [[ -n $(grep 'Load.*vnc' ${MROOT}@@SYSCONFDIR@@/X11/xorg.conf.d/25-module.conf) ]] |
68 |
then |
then |
69 |
mecho "VNC facility is enabled." |
mecho "VNC facility is enabled." |
70 |
rvecho "1" |
rvecho "1" |
80 |
|
|
81 |
set_vnc_service() |
set_vnc_service() |
82 |
{ |
{ |
83 |
local action="$1" |
local action="${CLASS_ARGV[0]}" |
84 |
if [[ -z ${action} ]] |
if [[ -z ${action} ]] |
85 |
then |
then |
86 |
help_vnc_service |
help_vnc_service |
108 |
|
|
109 |
set_vnc_passwd() |
set_vnc_passwd() |
110 |
{ |
{ |
111 |
local pass="$1" |
local pass="${CLASS_ARGV[0]}" |
112 |
local vncpasswd="${MROOT}/root/.vnc/passwd" |
local vncconfigdir="${MROOT}/root/.vnc" |
113 |
|
local vncpasswd="${vncconfigdir}/passwd" |
114 |
[[ -z ${pass} ]] && help_vnc_passwd && return 1 |
[[ -z ${pass} ]] && help_vnc_passwd && return 1 |
115 |
|
[ -d ${vncconfigdir} ] || install -d ${vncconfigdir} |
116 |
|
|
117 |
vncpasswd "${vncpasswd}" > /dev/null << EOF |
vncpasswd "${vncpasswd}" > /dev/null << EOF |
118 |
${pass} |
${pass} |
119 |
${pass} |
${pass} |
120 |
|
n |
121 |
EOF |
EOF |
122 |
} |
} |