Contents of /mcore-src/trunk/mcore-tools/daemon/client/include/vnc.client.class
Parent Directory | Revision Log
Revision 1263 -
(show annotations)
(download)
Fri Feb 4 20:06:54 2011 UTC (13 years, 7 months ago) by niro
File size: 1312 byte(s)
Fri Feb 4 20:06:54 2011 UTC (13 years, 7 months ago) by niro
File size: 1312 byte(s)
- use the new xorg.conf.d handling to en/disable the vnc module and its options - requires basic graphic to support the new xorg.conf.d handling
1 | # $Id$ |
2 | |
3 | provide x0vnc |
4 | require basic-video |
5 | |
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 | mecho " Sets given password for X0 display vnc." |
22 | } |
23 | |
24 | set_vnc_enable() |
25 | { |
26 | # add to module section |
27 | local CONFIG="${MCORE_CONFIG_PATH}/xorg/module/99-vnc.conf" |
28 | clearconfig |
29 | addconfig ' Load "vnc"' |
30 | |
31 | # add to screen section |
32 | local CONFIG="${MCORE_CONFIG_PATH}/xorg/screen/99-vnc.conf" |
33 | clearconfig |
34 | addconfig ' Option "SecurityTypes" "VncAuth"' |
35 | addconfig ' Option "UserPasswdVerifier" "VncAuth"' |
36 | addconfig ' Option "PasswordFile" "/root/.vncpasswd"' |
37 | |
38 | # requires graphic! |
39 | helper_graphic_rebuild_xorg_conf_d |
40 | |
41 | mecho "Done but X11 restart required!" |
42 | } |
43 | |
44 | set_vnc_disable() |
45 | { |
46 | local CONFIG="${MCORE_CONFIG_PATH}/xorg/screen/99-vnc.conf" |
47 | clearconfig |
48 | |
49 | local CONFIG="${MCORE_CONFIG_PATH}/xorg/module/99-vnc.conf" |
50 | clearconfig |
51 | |
52 | # requires graphic! |
53 | helper_graphic_rebuild_xorg_conf_d |
54 | |
55 | mecho "Done but X11 restart required!" |
56 | } |
57 | |
58 | set_vnc_passwd() |
59 | { |
60 | local pass="$1" |
61 | local vncpasswd="/root/.vncpasswd" |
62 | [[ -z ${pass} ]] && help_vnc_passwd && return 1 |
63 | |
64 | vncpasswd "${vncpasswd}" > /dev/null << EOF |
65 | ${pass} |
66 | ${pass} |
67 | EOF |
68 | } |