Annotation of /mcore-src/trunk/mcore-tools/daemon/client/mcored.in
Parent Directory | Revision Log
Revision 1916 -
(hide annotations)
(download)
(as text)
Wed Nov 9 13:24:37 2011 UTC (12 years, 10 months ago) by niro
Original Path: mcore-src/trunk/mcore-tools/daemon/client/mcored.sh
File MIME type: application/x-sh
File size: 2176 byte(s)
Wed Nov 9 13:24:37 2011 UTC (12 years, 10 months ago) by niro
Original Path: mcore-src/trunk/mcore-tools/daemon/client/mcored.sh
File MIME type: application/x-sh
File size: 2176 byte(s)
-support the reload of client classes -support restart of the service
1 | niro | 1248 | #!/bin/bash |
2 | |||
3 | MCLIBDIR="/usr/lib/mcored" | ||
4 | |||
5 | # globals | ||
6 | source ${MCLIBDIR}/include/daemon.global.class | ||
7 | source ${MCLIBDIR}/include/sessionauth.global.class | ||
8 | niro | 1251 | #source ${MCLIBDIR}/include/mysqlfunctions.global.class |
9 | niro | 1248 | source ${MCLIBDIR}/include/hwdetection.global.class |
10 | |||
11 | niro | 1916 | # load client classes plugins |
12 | load_client_classes | ||
13 | niro | 1248 | |
14 | # config settings | ||
15 | source /etc/mcore/config.rc | ||
16 | niro | 1344 | #source /etc/mcore/serial |
17 | niro | 1248 | |
18 | niro | 1251 | # import_hardware_resource() |
19 | # { | ||
20 | # local resource="$1" | ||
21 | # local value | ||
22 | # | ||
23 | # # special cases | ||
24 | # case ${resource} in | ||
25 | # gfxcard) value="$(get_x11_driver_modules)" ;; | ||
26 | # *) value="$(get_hwinfo --with-description ${resource})" ;; | ||
27 | # esac | ||
28 | # | ||
29 | # # if [[ ${DEBUG} = 1 ]] | ||
30 | # # then | ||
31 | # # echo "${resource}=${value}" >> /root/lala.log | ||
32 | # # echo "mysqldo \"update status set ${resource}='${value}' where serial=${ALX_SERIAL};\"" >> /root/lala.log | ||
33 | # # fi | ||
34 | # # mysql_insert status,serial="${ALX_SERIAL}","${resource}"="${value}" | ||
35 | # | ||
36 | # import_resource status "${ALX_SERIAL}" "${resource}" "${value}" | ||
37 | # } | ||
38 | niro | 1248 | |
39 | |||
40 | # set_init_state() | ||
41 | # { | ||
42 | # local ip | ||
43 | # ip=$(ifconfig | grep -A1 eth0 | grep inet | sed 's/.*inet\ addr:\(.*\) Bcast.*/\1/;') | ||
44 | # | ||
45 | # } | ||
46 | |||
47 | DEBUG=1 | ||
48 | niro | 1638 | NOCOLORS="false" |
49 | WEBCRLF="false" | ||
50 | QUIET="false" | ||
51 | niro | 1248 | |
52 | run=run | ||
53 | valid_session=no | ||
54 | |||
55 | while [[ ${run} = run ]] | ||
56 | do | ||
57 | read line | ||
58 | |||
59 | case ${line} in | ||
60 | quit) run=quit ;; | ||
61 | |||
62 | # only react on the globals -> import|get|set|auth | ||
63 | import*) run_class ${line} ;; | ||
64 | get*) run_class ${line} ;; | ||
65 | set*) run_class ${line} ;; | ||
66 | auth*) validate_auth ${line/auth /} ;; | ||
67 | niro | 1305 | provide) valid_session && print_provide ;; |
68 | require) valid_session && verify_requirements ;; | ||
69 | niro | 1916 | reload) valid_session && echo "reloading client classes ..." && load_client_classes ;; |
70 | restart) valid_session && restart_service ;; | ||
71 | niro | 1305 | nocolors) export NOCOLORS="true" ;; |
72 | webcrlf) export WEBCRLF="true" ;; | ||
73 | niro | 1638 | quiet) export QUIET="true" ;; |
74 | niro | 1248 | help*) |
75 | niro | 1305 | if valid_session |
76 | niro | 1248 | then |
77 | if [[ ${line} = help ]] | ||
78 | then | ||
79 | help_topics | ||
80 | else | ||
81 | run_class ${line} | ||
82 | fi | ||
83 | else | ||
84 | mecho "You must authenticate yourself first!" | ||
85 | mecho " auth [username] [password]" | ||
86 | fi | ||
87 | ;; | ||
88 | |||
89 | *) | ||
90 | mecho "Unkown command '${line}'" | ||
91 | mecho "Type 'help' for more information." | ||
92 | niro | 1894 | #echo "$line" >> /root/lala.log |
93 | niro | 1248 | ;; |
94 | esac | ||
95 | done |
Properties
Name | Value |
---|---|
svn:executable | * |