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 1256 by niro, Fri Feb 4 19:51:25 2011 UTC mcore-src/trunk/mcore-tools/daemon/client/mcored.in revision 2137 by niro, Fri Jan 10 10:16: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/daemon.global.class
13  source ${MCLIBDIR}/include/sessionauth.global.class  source ${MCORE_LIBDIR}/include/sessionauth.global.class
14  #source ${MCLIBDIR}/include/mysqlfunctions.global.class  #source ${MCORE_LIBDIR}/include/mysqlfunctions.global.class
15  source ${MCLIBDIR}/include/hwdetection.global.class  source ${MCORE_LIBDIR}/include/hwdetection.global.class
16    
17  # client specific  # load client classes plugins
18  for i in ${MCLIBDIR}/include/*.client.class  load_client_classes
 do  
  source ${i} || echo "error loading ${i}"  
 done  
19    
20  # config settings  # config settings
21  source /etc/mcore/config.rc  source @@SYSCONFDIR@@/mcore/config.rc
22  source /etc/mcore/serial  #source @@SYSCONFDIR@@/mcore/serial
23    
24  # import_hardware_resource()  # import_hardware_resource()
25  # {  # {
# Line 48  source /etc/mcore/serial Line 51  source /etc/mcore/serial
51  # }  # }
52    
53  DEBUG=1  DEBUG=1
54    NOCOLORS="false"
55    WEBCRLF="false"
56    QUIET="false"
57    
58  run=run  run=run
59  valid_session=no  valid_session=no
60    
61    # tell what we are
62    echo "Connected to $(print_version)"
63    
64  while [[ ${run} = run ]]  while [[ ${run} = run ]]
65  do  do
66   read line   read line
# Line 64  do Line 73  do
73   get*) run_class ${line} ;;   get*) run_class ${line} ;;
74   set*) run_class ${line} ;;   set*) run_class ${line} ;;
75   auth*) validate_auth ${line/auth /} ;;   auth*) validate_auth ${line/auth /} ;;
76   provide) print_provide ;;   provide) valid_session && print_provide ;;
77   require) verify_requirements ;;   require) valid_session && verify_requirements ;;
78     reload) valid_session && mecho "reloading client classes ..." && load_client_classes ;;
79     restart) valid_session && restart_service ;;
80     stop) valid_session && stop_service ;;
81     nocolors) export NOCOLORS="true" ;;
82     colors) export NOCOLORS="false" ;;
83     webcrlf) export WEBCRLF="true" ;;
84     quiet) export QUIET="true" ;;
85     # version does not need auth
86     version) print_version ;;
87   help*)   help*)
88   if validate_session   if valid_session
89   then   then
90   if [[ ${line} = help ]]   if [[ ${line} = help ]]
91   then   then
# Line 84  do Line 102  do
102   *)   *)
103   mecho "Unkown command '${line}'"   mecho "Unkown command '${line}'"
104   mecho "Type 'help' for more information."   mecho "Type 'help' for more information."
105   echo "$line" >> /root/lala.log   #echo "$line" >> /root/lala.log
106   ;;   ;;
107   esac   esac
108  done  done

Legend:
Removed from v.1256  
changed lines
  Added in v.2137