Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2563 - (show 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 # $Id$
2
3 import_resource()
4 {
5 local table="$1"
6 local serial="$2"
7 local resource="$3"
8 local value="$4"
9
10 decho "table '${table}'->resource '${resource}'=value '${value}' for serial='${serial}'"
11
12 mysql_insert "${table}",serial="${serial}","${resource}"="${value}"
13 }
14
15 control_client()
16 {
17 local argv=( $@ )
18 local serial="${argv[0]}"
19 local command="${argv[*]:1}"
20 local SSLSAY_IP
21 local SSLSAY_PORT
22
23 SSLSAY_IP=$(mysqldo "select ip from state_connected where serial='${serial}'")
24 if [[ -z ${SSLSAY_IP} ]]
25 then
26 echo "no ip found for client '${serial}'"
27 return 1
28 fi
29
30 SSLSAY_PORT="6666"
31 case "${command}" in
32 ' run-queue'|run-queue) nsslsay_queue_run_fingerprint ;;
33 *) nsslsay_fingerprint "${command}" ;;
34 esac
35 }