ppf: Replace hardcoded database name in libtorrent/log_parser with
authorMariana Marasoiu <mariana.marasoiu@gmail.com>
Tue, 16 Aug 2011 16:16:36 +0000 (19:16 +0300)
committerroot p2p-next-02 <root@p2p-next-02.grid.pub.ro>
Tue, 16 Aug 2011 16:20:19 +0000 (19:20 +0300)
configuration file received as argument.

ppf/log-parser-mysql/libtorrent/log_parser

index 39f9199..8020578 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 ARCHIVE=$1
-DB_NAME=$2
+DB_CONFIG=$2
 SWARM_ID=$3
 DIR_LOCAL="$(cd "$(dirname "$0")" && pwd)"
 DIR_ARCHIVE="$(cd "$(dirname "$1")" && pwd)"
@@ -31,7 +31,7 @@ for folder in $( find $DIR_ARCHIVE/temp -type d -name 'libtorrent_logs*' | sort
     for log_file in $(find $folder -type f | sort); do
         if [[ "$log_file" =~ [[:digit:]]*.log ]]; then
             echo "$log_file"
-            yes y | PYTHONPATH=$DIR_LOCAL/../../db-mysql/ python $DIR_LOCAL/LogParser.py -i $SWARM_ID -f $log_file $DB_NAME
+            yes y | PYTHONPATH=$DIR_LOCAL/../../db-mysql/ python $DIR_LOCAL/LogParser.py -i $SWARM_ID -f $log_file $DB_CONFIG
         fi
     done
 done
@@ -39,7 +39,7 @@ echo -e "Log files parsed.\n"
 
 # fill status information
 echo -e "Parsing status file.\n"
-yes y | PYTHONPATH=$DIR_LOCAL/../../db-mysql/ python $DIR_LOCAL/StatusParser.py -i $SWARM_ID -f $DIR_ARCHIVE/temp/status.log $DB_NAME
+yes y | PYTHONPATH=$DIR_LOCAL/../../db-mysql/ python $DIR_LOCAL/StatusParser.py -i $SWARM_ID -f $DIR_ARCHIVE/temp/status.log $DB_CONFIG
 echo -e "Status file parsed.\n"
 
 echo -e "DONE!\n"