5 |
# globals |
# globals |
6 |
source ${MCLIBDIR}/include/daemon.global.class |
source ${MCLIBDIR}/include/daemon.global.class |
7 |
source ${MCLIBDIR}/include/sessionauth.global.class |
source ${MCLIBDIR}/include/sessionauth.global.class |
8 |
source ${MCLIBDIR}/include/mysqlfunctions.global.class |
#source ${MCLIBDIR}/include/mysqlfunctions.global.class |
9 |
source ${MCLIBDIR}/include/hwdetection.global.class |
source ${MCLIBDIR}/include/hwdetection.global.class |
10 |
|
|
11 |
# client specific |
# load client classes plugins |
12 |
for i in ${MCLIBDIR}/include/*.client.class |
load_client_classes |
|
do |
|
|
source ${i} || echo "error loading ${i}" |
|
|
done |
|
13 |
|
|
14 |
# config settings |
# config settings |
15 |
source /etc/mcore/config.rc |
source /etc/mcore/config.rc |
16 |
source /etc/mcore/serial |
#source /etc/mcore/serial |
|
|
|
|
import_hardware_resource() |
|
|
{ |
|
|
local resource="$1" |
|
|
local value |
|
|
|
|
|
# special cases |
|
|
case ${resource} in |
|
|
gfxcard) value="$(get_x11_driver_modules)" ;; |
|
|
*) value="$(get_hwinfo --with-description ${resource})" ;; |
|
|
esac |
|
17 |
|
|
18 |
# if [[ ${DEBUG} = 1 ]] |
# import_hardware_resource() |
19 |
# then |
# { |
20 |
# echo "${resource}=${value}" >> /root/lala.log |
# local resource="$1" |
21 |
# echo "mysqldo \"update status set ${resource}='${value}' where serial=${ALX_SERIAL};\"" >> /root/lala.log |
# local value |
22 |
# fi |
# |
23 |
# mysql_insert status,serial="${ALX_SERIAL}","${resource}"="${value}" |
# # special cases |
24 |
|
# case ${resource} in |
25 |
import_resource status "${ALX_SERIAL}" "${resource}" "${value}" |
# 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 |
|
|
39 |
|
|
40 |
# set_init_state() |
# set_init_state() |
45 |
# } |
# } |
46 |
|
|
47 |
DEBUG=1 |
DEBUG=1 |
48 |
|
NOCOLORS="false" |
49 |
|
WEBCRLF="false" |
50 |
|
QUIET="false" |
51 |
|
|
52 |
run=run |
run=run |
53 |
valid_session=no |
valid_session=no |
64 |
get*) run_class ${line} ;; |
get*) run_class ${line} ;; |
65 |
set*) run_class ${line} ;; |
set*) run_class ${line} ;; |
66 |
auth*) validate_auth ${line/auth /} ;; |
auth*) validate_auth ${line/auth /} ;; |
67 |
provide) print_provide ;; |
provide) valid_session && print_provide ;; |
68 |
|
require) valid_session && verify_requirements ;; |
69 |
|
reload) valid_session && mecho "reloading client classes ..." && load_client_classes ;; |
70 |
|
restart) valid_session && restart_service ;; |
71 |
|
nocolors) export NOCOLORS="true" ;; |
72 |
|
webcrlf) export WEBCRLF="true" ;; |
73 |
|
quiet) export QUIET="true" ;; |
74 |
help*) |
help*) |
75 |
if validate_session |
if valid_session |
76 |
then |
then |
77 |
if [[ ${line} = help ]] |
if [[ ${line} = help ]] |
78 |
then |
then |
89 |
*) |
*) |
90 |
mecho "Unkown command '${line}'" |
mecho "Unkown command '${line}'" |
91 |
mecho "Type 'help' for more information." |
mecho "Type 'help' for more information." |
92 |
echo "$line" >> /root/lala.log |
#echo "$line" >> /root/lala.log |
93 |
;; |
;; |
94 |
esac |
esac |
95 |
done |
done |