Magellan Linux

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

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

revision 2440 by niro, Thu Sep 3 12:58:05 2015 UTC revision 2469 by niro, Tue Sep 8 08:29:24 2015 UTC
# Line 23  load_classes control Line 23  load_classes control
23  # config settings  # config settings
24  include @@SYSCONFDIR@@/mcore/mcore.conf  include @@SYSCONFDIR@@/mcore/mcore.conf
25    
26  SQL_USER=alx  SQL_USER=alx_install
27  SQL_PASS=@lx  SQL_PASS=@lx
28  SQL_HOST=localhost  SQL_HOST=localhost
29  SQL_DB=alx_web  SQL_DB=alx_web
30    
 import_resource()  
 {  
  local table="$1"  
  local serial="$2"  
  local resource="$3"  
  local value="$4"  
   
  if [[ ${DEBUG} = 1 ]]  
  then  
  echo "${table}->${resource}=${value}" >> /root/lala.log  
  echo "mysqldo \"update ${table} set ${resource}='${value}' where serial=${serial};\"" >> /root/lala.log  
  fi  
   
  mysql_insert "${table}",serial="${serial}","${resource}"="${value}"  
 }  
   
 nsslsay()  
 {  
  nssl "${IP}" "${PORT}" << EOF  
 auth ${SSLSAY_USER} ${SSLSAY_PASS}  
 $@  
 quit  
 EOF  
 }  
   
 control_client()  
 {  
  local serial="$1"  
  local command="${@/$1/}"  
  local IP  
   
  IP=$(mysqldo "select ip from state_connected where serial='${serial}'")  
  if [[ -z ${IP} ]]  
  then  
  echo "no ip found for client '${serial}'"  
  return 1  
  fi  
   
  nsslsay "${command}"  
 }  
   
 #IP="192.168.0.6"  
 PORT="6666"  
 SSLSAY_USER="foo"  
 SSLSAY_PASS="bar"  
   
31  DEBUG=1  DEBUG=1
32  NOCOLORS="false"  NOCOLORS="false"
33  WEBCRLF="false"  WEBCRLF="false"

Legend:
Removed from v.2440  
changed lines
  Added in v.2469