Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/daemon/client/mcored.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1248 by niro, Wed Feb 2 20:20:24 2011 UTC revision 1894 by niro, Fri Nov 4 08:22:24 2011 UTC
# Line 5  MCLIBDIR="/usr/lib/mcored" Line 5  MCLIBDIR="/usr/lib/mcored"
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  # client specific
# Line 16  done Line 16  done
16    
17  # config settings  # config settings
18  source /etc/mcore/config.rc  source /etc/mcore/config.rc
19  source /etc/mcore/serial  #source /etc/mcore/serial
20    
21  import_hardware_resource()  # import_hardware_resource()
22  {  # {
23   local resource="$1"  # local resource="$1"
24   local value  # local value
25    #
26   # special cases  # # special cases
27   case ${resource} in  # case ${resource} in
28   gfxcard) value="$(get_x11_driver_modules)" ;;  # gfxcard) value="$(get_x11_driver_modules)" ;;
29   *) value="$(get_hwinfo --with-description ${resource})" ;;  # *) value="$(get_hwinfo --with-description ${resource})" ;;
30   esac  # esac
31    #
32  # if [[ ${DEBUG} = 1 ]]  # # if [[ ${DEBUG} = 1 ]]
33  # then  # # then
34  # echo "${resource}=${value}" >> /root/lala.log  # # echo "${resource}=${value}" >> /root/lala.log
35  # echo "mysqldo \"update status set ${resource}='${value}' where serial=${ALX_SERIAL};\"" >> /root/lala.log  # # echo "mysqldo \"update status set ${resource}='${value}' where serial=${ALX_SERIAL};\"" >> /root/lala.log
36  # fi  # # fi
37  # mysql_insert status,serial="${ALX_SERIAL}","${resource}"="${value}"  # # mysql_insert status,serial="${ALX_SERIAL}","${resource}"="${value}"
38    #
39   import_resource status "${ALX_SERIAL}" "${resource}" "${value}"  # import_resource status "${ALX_SERIAL}" "${resource}" "${value}"
40  }  # }
41    
42    
43  # set_init_state()  # set_init_state()
# Line 48  import_hardware_resource() Line 48  import_hardware_resource()
48  # }  # }
49    
50  DEBUG=1  DEBUG=1
51    NOCOLORS="false"
52    WEBCRLF="false"
53    QUIET="false"
54    
55  run=run  run=run
56  valid_session=no  valid_session=no
# Line 64  do Line 67  do
67   get*) run_class ${line} ;;   get*) run_class ${line} ;;
68   set*) run_class ${line} ;;   set*) run_class ${line} ;;
69   auth*) validate_auth ${line/auth /} ;;   auth*) validate_auth ${line/auth /} ;;
70   provide) print_provide ;;   provide) valid_session && print_provide ;;
71     require) valid_session && verify_requirements ;;
72     nocolors) export NOCOLORS="true" ;;
73     webcrlf) export WEBCRLF="true" ;;
74     quiet) export QUIET="true" ;;
75   help*)   help*)
76   if validate_session   if valid_session
77   then   then
78   if [[ ${line} = help ]]   if [[ ${line} = help ]]
79   then   then
# Line 83  do Line 90  do
90   *)   *)
91   mecho "Unkown command '${line}'"   mecho "Unkown command '${line}'"
92   mecho "Type 'help' for more information."   mecho "Type 'help' for more information."
93   echo "$line" >> /root/lala.log   #echo "$line" >> /root/lala.log
94   ;;   ;;
95   esac   esac
96  done  done

Legend:
Removed from v.1248  
changed lines
  Added in v.1894