Contents of /mcore-src/trunk/mcore-tools/src/modules/tigervnc/vnc.control.class.in
Parent Directory
|
Revision Log
Revision 2619 -
(show annotations)
(download)
Fri Sep 25 08:14:48 2015 UTC (8 years, 8 months ago) by niro
File size: 1660 byte(s)
Fri Sep 25 08:14:48 2015 UTC (8 years, 8 months ago) by niro
File size: 1660 byte(s)
-fixed typos
1 | # $Id$ |
2 | |
3 | push_config 80_vnc_service 80_vnc_passwd |
4 | |
5 | help_vnc_service() |
6 | { |
7 | local serial="${CLASS_ARGV[0]}" |
8 | control_client "${serial}" help system.reboot |
9 | } |
10 | |
11 | help_vnc_passwd() |
12 | { |
13 | local serial="${CLASS_ARGV[0]}" |
14 | control_client "${serial}" help system.reboot |
15 | } |
16 | |
17 | set_vnc_service() |
18 | { |
19 | local serial="${CLASS_ARGV[0]}" |
20 | local action="${CLASS_ARGV[1]}" |
21 | local value |
22 | |
23 | case "${action}" in |
24 | enable) value=1 ;; |
25 | disable) value=0 ;; |
26 | *) |
27 | eecho "Unknown action '${action}'" |
28 | return 1 |
29 | ;; |
30 | esac |
31 | |
32 | import_resource cfg_vnc "${serial}" service "${value}" |
33 | } |
34 | |
35 | control_vnc_service() |
36 | { |
37 | local serial="${CLASS_ARGV[0]}" |
38 | push_config_80_vnc_service "${serial}" |
39 | } |
40 | |
41 | set_vnc_passwd() |
42 | { |
43 | local serial="${CLASS_ARGV[0]}" |
44 | local value="${CLASS_ARGV[1]}" |
45 | |
46 | import_resource client_auth "${serial}" vnc "${value}" |
47 | } |
48 | |
49 | control_vnc_passwd() |
50 | { |
51 | local serial="${CLASS_ARGV[0]}" |
52 | push_config_80_vnc_passwd "${serial}" |
53 | } |
54 | |
55 | push_config_80_vnc_service() |
56 | { |
57 | local serial="$1" |
58 | local value |
59 | local action |
60 | |
61 | value=$(mysqldo "select service from cfg_vnc where serial='${serial}'") |
62 | if [[ -z ${value} ]] || [[ ${value} = NULL ]] |
63 | then |
64 | decho "retval NULL, not running 'control_client '${serial}' set vnc.service '${value}''" |
65 | else |
66 | case "${value}" in |
67 | 0) action="disable" ;; |
68 | 1) action="enable" ;; |
69 | esac |
70 | |
71 | control_client "${serial}" set vnc.service "${action}" |
72 | fi |
73 | } |
74 | |
75 | push_config_80_vnc_passwd() |
76 | { |
77 | local serial="$1" |
78 | local value |
79 | |
80 | value=$(mysqldo "select vnc from client_auth where serial='${serial}'") |
81 | if [[ ${value} = NULL ]] |
82 | then |
83 | decho "retval NULL, not running 'control_client '${serial}' set vnc.passwd '${value}''" |
84 | else |
85 | control_client "${serial}" set vnc.passwd "${value}" |
86 | fi |
87 | } |