Magellan Linux

Annotation of /mcore-src/trunk/mcore-tools/src/mcored.in

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:executable *