Magellan Linux

Annotation of /mcore-src/trunk/mcore-tools/src/include/control.global.class.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2563 - (hide annotations) (download)
Thu Sep 17 08:52:18 2015 UTC (8 years, 7 months ago) by niro
File size: 722 byte(s)
-fixed broken argument evalution: do not remove serial from every place in the argument string. use argv evalution and remove argv[0]. serial='4' command='set graphic.resolution 1024x768' resulted in a broken 'set graphic.resolution 102x786'
1 niro 2465 # $Id$
2    
3     import_resource()
4     {
5     local table="$1"
6     local serial="$2"
7     local resource="$3"
8     local value="$4"
9    
10 niro 2528 decho "table '${table}'->resource '${resource}'=value '${value}' for serial='${serial}'"
11 niro 2465
12     mysql_insert "${table}",serial="${serial}","${resource}"="${value}"
13     }
14 niro 2466
15     control_client()
16     {
17 niro 2563 local argv=( $@ )
18     local serial="${argv[0]}"
19     local command="${argv[*]:1}"
20 niro 2468 local SSLSAY_IP
21 niro 2472 local SSLSAY_PORT
22 niro 2466
23 niro 2468 SSLSAY_IP=$(mysqldo "select ip from state_connected where serial='${serial}'")
24     if [[ -z ${SSLSAY_IP} ]]
25 niro 2466 then
26     echo "no ip found for client '${serial}'"
27     return 1
28     fi
29    
30 niro 2472 SSLSAY_PORT="6666"
31 niro 2489 case "${command}" in
32 niro 2492 ' run-queue'|run-queue) nsslsay_queue_run_fingerprint ;;
33 niro 2489 *) nsslsay_fingerprint "${command}" ;;
34     esac
35 niro 2466 }