Magellan Linux

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

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

mcore-src/trunk/mcore-tools/daemon/client/mcored.sh revision 1251 by niro, Wed Feb 2 21:17:12 2011 UTC mcore-src/trunk/mcore-tools/src/mcored.in revision 2243 by niro, Mon Jan 13 09:27:41 2014 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2    
3  MCLIBDIR="/usr/lib/mcored"  MCORE_LIBDIR="@@MCORE_LIBDIR@@"
4    
5    # respect system env (proxy settings etc)
6    if [ -e @@SYSCONFDIR@@/profile ]
7    then
8     source @@SYSCONFDIR@@/profile
9    fi
10    
11  # globals  # globals
12  source ${MCLIBDIR}/include/daemon.global.class  source ${MCORE_LIBDIR}/include/common.global.class
13  source ${MCLIBDIR}/include/sessionauth.global.class  source ${MCORE_LIBDIR}/include/daemon.global.class
14  #source ${MCLIBDIR}/include/mysqlfunctions.global.class  source ${MCORE_LIBDIR}/include/sessionauth.global.class
15  source ${MCLIBDIR}/include/hwdetection.global.class  #source ${MCORE_LIBDIR}/include/mysqlfunctions.global.class
16    source ${MCORE_LIBDIR}/include/hwdetection.global.class
17    
18  # client specific  # load client classes plugins
19  for i in ${MCLIBDIR}/include/*.client.class  load_client_classes
 do  
  source ${i} || echo "error loading ${i}"  
 done  
20    
21  # config settings  # config settings
22  source /etc/mcore/config.rc  source @@SYSCONFDIR@@/mcore/mcore.conf
23  source /etc/mcore/serial  #source @@SYSCONFDIR@@/mcore/serial
24    
25  # import_hardware_resource()  # import_hardware_resource()
26  # {  # {
# Line 48  source /etc/mcore/serial Line 52  source /etc/mcore/serial
52  # }  # }
53    
54  DEBUG=1  DEBUG=1
55    NOCOLORS="false"
56    WEBCRLF="false"
57    QUIET="false"
58    
59  run=run  run=run
60  valid_session=no  valid_session=no
61    
62    # tell what we are
63    echo "Connected to $(print_version)"
64    
65  while [[ ${run} = run ]]  while [[ ${run} = run ]]
66  do  do
67   read line   read line
# Line 64  do Line 74  do
74   get*) run_class ${line} ;;   get*) run_class ${line} ;;
75   set*) run_class ${line} ;;   set*) run_class ${line} ;;
76   auth*) validate_auth ${line/auth /} ;;   auth*) validate_auth ${line/auth /} ;;
77   provide) print_provide ;;   provide) valid_session && print_provide ;;
78     require) valid_session && verify_requirements ;;
79     reload) valid_session && mecho "reloading client classes ..." && load_client_classes ;;
80     restart) valid_session && restart_service ;;
81     stop) valid_session && stop_service ;;
82     nocolors) export NOCOLORS="true" ;;
83     colors) export NOCOLORS="false" ;;
84     webcrlf) export WEBCRLF="true" ;;
85     quiet) export QUIET="true" ;;
86     # version does not need auth
87     version) print_version ;;
88   help*)   help*)
89   if validate_session   if valid_session
90   then   then
91   if [[ ${line} = help ]]   if [[ ${line} = help ]]
92   then   then
# Line 81  do Line 101  do
101   ;;   ;;
102    
103   *)   *)
104   mecho "Unkown command '${line}'"   mecho "Unknown command '${line}'"
105   mecho "Type 'help' for more information."   mecho "Type 'help' for more information."
106   echo "$line" >> /root/lala.log   #echo "$line" >> /root/lala.log
107   ;;   ;;
108   esac   esac
109  done  done

Legend:
Removed from v.1251  
changed lines
  Added in v.2243