Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2062 - (hide annotations) (download)
Wed May 8 13:04:27 2013 UTC (10 years, 11 months ago) by niro
Original Path: mcore-src/trunk/mcore-tools/daemon/client/include/vnc.client.class
File size: 1358 byte(s)
-use default vnc passwd location of tigervnc
1 niro 1248 # $Id$
2    
3     provide x0vnc
4 niro 1263 require basic-video
5 niro 1248
6     help_vnc_enable()
7     {
8     mecho "Enable vnc for the X0 display"
9     mecho "X11 restart required!"
10     }
11    
12     help_vnc_disable()
13     {
14     mecho "Disable vnc for the X0 display"
15     mecho "X11 restart required!"
16     }
17    
18     help_vnc_passwd()
19     {
20     mecho "set vnc.passwd [password]"
21 niro 1263 mecho " Sets given password for X0 display vnc."
22 niro 1248 }
23    
24     set_vnc_enable()
25     {
26 niro 1263 # add to module section
27 niro 2024 local CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/module/99-vnc.conf"
28 niro 1248 clearconfig
29 niro 1263 addconfig ' Load "vnc"'
30 niro 1248
31 niro 1263 # add to screen section
32 niro 2024 local CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/99-vnc.conf"
33 niro 1263 clearconfig
34     addconfig ' Option "SecurityTypes" "VncAuth"'
35     addconfig ' Option "UserPasswdVerifier" "VncAuth"'
36 niro 2062 addconfig ' Option "PasswordFile" "/root/.vnc/passwd"'
37 niro 1263
38     # requires graphic!
39     helper_graphic_rebuild_xorg_conf_d
40    
41     mecho "Done but X11 restart required!"
42 niro 1248 }
43    
44     set_vnc_disable()
45     {
46 niro 2024 local CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/99-vnc.conf"
47 niro 1263 clearconfig
48    
49 niro 2024 local CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/module/99-vnc.conf"
50 niro 1263 clearconfig
51    
52     # requires graphic!
53     helper_graphic_rebuild_xorg_conf_d
54    
55     mecho "Done but X11 restart required!"
56 niro 1248 }
57    
58     set_vnc_passwd()
59     {
60     local pass="$1"
61 niro 2062 local vncpasswd="${MROOT}/root/.vnc/passwd"
62 niro 1248 [[ -z ${pass} ]] && help_vnc_passwd && return 1
63    
64     vncpasswd "${vncpasswd}" > /dev/null << EOF
65     ${pass}
66     ${pass}
67     EOF
68     }