--- mcore-src/trunk/mcore-tools/daemon/client/include/vnc.client.class 2013/05/08 14:20:21 2069 +++ mcore-src/trunk/mcore-tools/daemon/client/include/vnc.client.class 2013/05/08 16:00:40 2070 @@ -3,25 +3,30 @@ provide x0vnc require basic-video -help_vnc_enable() +help_vnc_service() { - mecho "Enable vnc for the X0 display" - mecho "X11 restart required!" -} - -help_vnc_disable() -{ - mecho "Disable vnc for the X0 display" - mecho "X11 restart required!" + mecho "get vnc.service" + mecho " Shows X0-VNC facility status." + mecho + mecho "set vnc.service [command]" + mecho " Controls the X0-VNC facility." + mecho " Commands:" + mecho " enable - Enable vnc for the X0 display" + mecho " disable - Disable vnc for the X0 display" + mecho + mecho " X11 restart is required!" } help_vnc_passwd() { + mecho "get vnc.passwd" + mecho " Shows if a vnc password was set." + mecho mecho "set vnc.passwd [password]" - mecho " Sets given password for X0 display vnc." + mecho " Sets given vnc password for remote connections." } -set_vnc_enable() +helper_vnc_enable() { # add to module section local CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/module/99-vnc.conf" @@ -41,7 +46,7 @@ mecho "Done but X11 restart required!" } -set_vnc_disable() +helper_vnc_disable() { local CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/99-vnc.conf" clearconfig @@ -55,6 +60,52 @@ mecho "Done but X11 restart required!" } +get_vnc_service() +{ + if [ -f ${MROOT}/etc/X11/xorg.conf.d/25-module.conf ] + then + if [[ -n $(grep 'Load.*vnc' ${MROOT}/etc/X11/xorg.conf.d/25-module.conf) ]] + then + mecho "VNC facility is enabled." + rvecho "1" + else + mecho "VNC facility is disabled." + rvecho "0" + fi + else + mecho "VNC facility not configured yet." + rvecho "0" + fi +} + +set_vnc_service() +{ + local action="$1" + if [[ -z ${action} ]] + then + help_vnc_service + return 1 + fi + + case ${action} in + enable) helper_vnc_enable ;; + disable) helper_vnc_disable ;; + *) help_vnc_service && return 1 ;; + esac +} + +get_vnc_passwd() +{ + if [ -s ${MROOT}/root/.vnc/passwd ] + then + mecho "A VNC password was set." + rvecho "1" + else + mecho "No VNC password was set yet." + rvecho "0" + fi +} + set_vnc_passwd() { local pass="$1"