Magellan Linux

Contents of /mcore-src/trunk/mcore-tools/daemon/client/include/vnc.client.class

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1248 - (show annotations) (download)
Wed Feb 2 20:20:24 2011 UTC (13 years, 3 months ago) by niro
File size: 789 byte(s)
-initial version
1 # $Id$
2
3 provide x0vnc
4
5 help_vnc_enable()
6 {
7 mecho "Enable vnc for the X0 display"
8 mecho "X11 restart required!"
9 }
10
11 help_vnc_disable()
12 {
13 mecho "Disable vnc for the X0 display"
14 mecho "X11 restart required!"
15 }
16
17 help_vnc_passwd()
18 {
19 mecho "set vnc.passwd [password]"
20 mecho " sets given password for X0 display vnc."
21 }
22
23 set_vnc_enable()
24 {
25 local CONFIG="/etc/X11/xorg.conf.d/25-vnc.conf"
26 clearconfig
27
28 addconfig 'Section "Module"'
29 addconfig ' Load "vnc"'
30 addconfig 'EndSection'
31 }
32
33 set_vnc_disable()
34 {
35 if [[ -f /etc/X11/xorg.conf.d/25-vnc.conf ]]
36 then
37 rm /etc/X11/xorg.conf.d/25-vnc.conf
38 fi
39 }
40
41 set_vnc_passwd()
42 {
43 local pass="$1"
44 local vncpasswd="/root/.vncpasswd"
45 [[ -z ${pass} ]] && help_vnc_passwd && return 1
46
47 vncpasswd "${vncpasswd}" > /dev/null << EOF
48 ${pass}
49 ${pass}
50 EOF
51 }