Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/src/modules/tigervnc/vnc.client.class.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2170 by niro, Fri Jan 10 14:08:55 2014 UTC revision 2835 by niro, Wed Sep 5 07:36:12 2018 UTC
# Line 37  helper_vnc_enable() Line 37  helper_vnc_enable()
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
# Line 62  helper_vnc_disable() Line 62  helper_vnc_disable()
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"
# Line 80  get_vnc_service() Line 80  get_vnc_service()
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
# Line 96  set_vnc_service() Line 96  set_vnc_service()
96    
97  get_vnc_passwd()  get_vnc_passwd()
98  {  {
99   if [ -s ${MROOT}/root/.vnc/passwd ]   trysudo test -s ${MROOT}/root/.vnc/passwd
100     if [ $? -eq 0 ]
101   then   then
102   mecho "A VNC password was set."   mecho "A VNC password was set."
103   rvecho "1"   rvecho "1"
# Line 108  get_vnc_passwd() Line 109  get_vnc_passwd()
109    
110  set_vnc_passwd()  set_vnc_passwd()
111  {  {
112   local pass="$1"   local pass="${CLASS_ARGV[0]}"
113   local vncconfigdir="${MROOT}/root/.vnc"   local vncconfigdir="${MROOT}/root/.vnc"
114   local vncpasswd="${vncconfigdir}/passwd"   local vncpasswd="${vncconfigdir}/passwd"
115   [[ -z ${pass} ]] && help_vnc_passwd && return 1   [[ -z ${pass} ]] && help_vnc_passwd && return 1
116   [ -d ${vncconfigdir} ] || install -d ${vncconfigdir}   trysudo test -d ${vncconfigdir} ] || trysudo install -d ${vncconfigdir}
117    
118   vncpasswd "${vncpasswd}" > /dev/null << EOF   trysudo vncpasswd "${vncpasswd}" &> /dev/null << EOF
119  ${pass}  ${pass}
120  ${pass}  ${pass}
121    n
122  EOF  EOF
123     if [ $? -eq 0 ]
124     then
125     mecho "A VNC password was successfully set."
126     rvecho "1"
127     else
128     mecho "Could not set a VNC password."
129     rvecho "0"
130     fi
131  }  }

Legend:
Removed from v.2170  
changed lines
  Added in v.2835