Annotation of /mcore-src/trunk/mcore-tools/daemon/client/include/vnc.client.class
Parent Directory | Revision Log
Revision 2024 -
(hide annotations)
(download)
Mon Aug 13 11:27:11 2012 UTC (12 years, 1 month ago) by niro
File size: 1356 byte(s)
Mon Aug 13 11:27:11 2012 UTC (12 years, 1 month ago) by niro
File size: 1356 byte(s)
-support $MROOT variable
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 | 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 | 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 | 2024 | local vncpasswd="${MROOT}/root/.vncpasswd" |
62 | niro | 1248 | [[ -z ${pass} ]] && help_vnc_passwd && return 1 |
63 | |||
64 | vncpasswd "${vncpasswd}" > /dev/null << EOF | ||
65 | ${pass} | ||
66 | ${pass} | ||
67 | EOF | ||
68 | } |