From cee2b2486f0e7fc5d62b6105e8324753246e3663 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Tue, 26 Mar 2019 16:45:01 +0100 Subject: [PATCH] chg: [Launch] remove old launchers --- bin/LAUNCH.sh | 51 ++++++++++++++++++++++++---- bin/launch_ardb.sh | 21 ------------ bin/launch_logs.sh | 16 --------- bin/launch_queues.sh | 15 --------- bin/launch_redis.sh | 23 ------------- bin/launch_scripts.sh | 77 ------------------------------------------- 6 files changed, 45 insertions(+), 158 deletions(-) delete mode 100755 bin/launch_ardb.sh delete mode 100755 bin/launch_logs.sh delete mode 100755 bin/launch_queues.sh delete mode 100755 bin/launch_redis.sh delete mode 100755 bin/launch_scripts.sh diff --git a/bin/LAUNCH.sh b/bin/LAUNCH.sh index 2e6dd6e6..b281557e 100755 --- a/bin/LAUNCH.sh +++ b/bin/LAUNCH.sh @@ -82,11 +82,27 @@ function helptext { } function launching_redis { - bash -c "bash ${AIL_BIN}/launch_redis.sh" + conf_dir="${AIL_HOME}/configs/" + + screen -dmS "Redis_AIL" + sleep 0.1 + echo -e $GREEN"\t* Launching Redis servers"$DEFAULT + screen -S "Redis_AIL" -X screen -t "6379" bash -c 'redis-server '$conf_dir'6379.conf ; read x' + sleep 0.1 + screen -S "Redis_AIL" -X screen -t "6380" bash -c 'redis-server '$conf_dir'6380.conf ; read x' + sleep 0.1 + screen -S "Redis_AIL" -X screen -t "6381" bash -c 'redis-server '$conf_dir'6381.conf ; read x' } function launching_ardb { - bash -c "bash ${AIL_BIN}/launch_ardb.sh" + conf_dir="${AIL_HOME}/configs/" + + screen -dmS "ARDB_AIL" + sleep 0.1 + echo -e $GREEN"\t* Launching ARDB servers"$DEFAULT + + sleep 0.1 + screen -S "ARDB_AIL" -X screen -t "6382" bash -c 'cd '${AIL_HOME}'; ardb-server '$conf_dir'6382.conf ; read x' } function launching_logs { @@ -247,19 +263,37 @@ function shutting_down_ardb { function checking_redis { flag_redis=0 - bash -c "bash ${AIL_BIN}/check_redis.sh" + redis_dir=${AIL_HOME}/redis/src/ + bash -c $redis_dir'redis-cli -p 6379 PING | grep "PONG" &> /dev/null' if [ ! $? == 0 ]; then - flag_redis=1 + echo -e $RED"\t6379 not ready"$DEFAULT + flag_redis=1 fi + sleep 0.1 + bash -c $redis_dir'redis-cli -p 6380 PING | grep "PONG" &> /dev/null' + if [ ! $? == 0 ]; then + echo -e $RED"\t6380 not ready"$DEFAULT + flag_redis=1 + fi + sleep 0.1 + bash -c $redis_dir'redis-cli -p 6381 PING | grep "PONG" &> /dev/null' + if [ ! $? == 0 ]; then + echo -e $RED"\t6381 not ready"$DEFAULT + flag_redis=1 + fi + sleep 0.1 return $flag_redis; } function checking_ardb { flag_ardb=0 - bash -c "bash ${AIL_BIN}/check_ardb.sh" + redis_dir=${AIL_HOME}/redis/src/ + sleep 0.2 + bash -c $redis_dir'redis-cli -p 6382 PING | grep "PONG" &> /dev/null' if [ ! $? == 0 ]; then - flag_ardb=1 + echo -e $RED"\t6382 ARDB not ready"$DEFAULT + flag_ardb=1 fi return $flag_ardb; @@ -475,6 +509,8 @@ function launch_all { exit } +echo "$@" + while [ "$1" != "" ]; do case $1 in -l | --launchAuto ) launch_all "automatic"; @@ -491,6 +527,9 @@ while [ "$1" != "" ]; do ;; -h | --help ) helptext; exit + ;; + -kh | --khelp ) helptext; + ;; * ) helptext exit 1 diff --git a/bin/launch_ardb.sh b/bin/launch_ardb.sh deleted file mode 100755 index 9d6ea1e7..00000000 --- a/bin/launch_ardb.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -GREEN="\\033[1;32m" -DEFAULT="\\033[0;39m" -RED="\\033[1;31m" -ROSE="\\033[1;35m" -BLUE="\\033[1;34m" -WHITE="\\033[0;02m" -YELLOW="\\033[1;33m" -CYAN="\\033[1;36m" - -[ -z "$AIL_HOME" ] && echo "Needs the env var AIL_HOME. Run the script from the virtual environment." && exit 1; - -conf_dir="${AIL_HOME}/configs/" - -screen -dmS "ARDB_AIL" -sleep 0.1 -echo -e $GREEN"\t* Launching ARDB servers"$DEFAULT - -sleep 0.1 -screen -S "ARDB_AIL" -X screen -t "6382" bash -c 'cd '${AIL_HOME}'; ardb-server '$conf_dir'6382.conf ; read x' diff --git a/bin/launch_logs.sh b/bin/launch_logs.sh deleted file mode 100755 index ed08ea48..00000000 --- a/bin/launch_logs.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set -e -set -x - -[ -z "$AIL_HOME" ] && echo "Needs the env var AIL_HOME. Run the script from the virtual environment." && exit 1; -[ -z "$AIL_REDIS" ] && echo "Needs the env var AIL_REDIS. Run the script from the virtual environment." && exit 1; -[ -z "$AIL_LEVELDB" ] && echo "Needs the env var AIL_LEVELDB. Run the script from the virtual environment." && exit 1; - -screen -dmS "Logging" -sleep 0.1 -echo -e $GREEN"\t* Launching logging process"$DEFAULT -screen -S "Logging" -X screen -t "LogQueue" bash -c 'log_subscriber -p 6380 -c Queuing -l ../logs/; read x' -sleep 0.1 -screen -S "Logging" -X screen -t "LogScript" bash -c 'log_subscriber -p 6380 -c Script -l ../logs/; read x' - diff --git a/bin/launch_queues.sh b/bin/launch_queues.sh deleted file mode 100755 index 2ddd2b7d..00000000 --- a/bin/launch_queues.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -set -e -set -x - -[ -z "$AIL_HOME" ] && echo "Needs the env var AIL_HOME. Run the script from the virtual environment." && exit 1; -[ -z "$AIL_REDIS" ] && echo "Needs the env var AIL_REDIS. Run the script from the virtual environment." && exit 1; -[ -z "$AIL_LEVELDB" ] && echo "Needs the env var AIL_LEVELDB. Run the script from the virtual environment." && exit 1; - -screen -dmS "Queue" -sleep 0.1 - -echo -e $GREEN"\t* Launching all the queues"$DEFAULT -screen -S "Queue" -X screen -t "Queues" bash -c './launch_queues.py; read x' - diff --git a/bin/launch_redis.sh b/bin/launch_redis.sh deleted file mode 100755 index 91c35f4d..00000000 --- a/bin/launch_redis.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -GREEN="\\033[1;32m" -DEFAULT="\\033[0;39m" -RED="\\033[1;31m" -ROSE="\\033[1;35m" -BLUE="\\033[1;34m" -WHITE="\\033[0;02m" -YELLOW="\\033[1;33m" -CYAN="\\033[1;36m" - -[ -z "$AIL_HOME" ] && echo "Needs the env var AIL_HOME. Run the script from the virtual environment." && exit 1; - -conf_dir="${AIL_HOME}/configs/" - -screen -dmS "Redis_AIL" -sleep 0.1 -echo -e $GREEN"\t* Launching Redis servers"$DEFAULT -screen -S "Redis_AIL" -X screen -t "6379" bash -c 'redis-server '$conf_dir'6379.conf ; read x' -sleep 0.1 -screen -S "Redis_AIL" -X screen -t "6380" bash -c 'redis-server '$conf_dir'6380.conf ; read x' -sleep 0.1 -screen -S "Redis_AIL" -X screen -t "6381" bash -c 'redis-server '$conf_dir'6381.conf ; read x' diff --git a/bin/launch_scripts.sh b/bin/launch_scripts.sh deleted file mode 100755 index 0dd29c2f..00000000 --- a/bin/launch_scripts.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash - -set -e -set -x - -[ -z "$AIL_HOME" ] && echo "Needs the env var AIL_HOME. Run the script from the virtual environment." && exit 1; -[ -z "$AIL_REDIS" ] && echo "Needs the env var AIL_REDIS. Run the script from the virtual environment." && exit 1; -[ -z "$AIL_LEVELDB" ] && echo "Needs the env var AIL_LEVELDB. Run the script from the virtual environment." && exit 1; - -echo -e "\t* Checking configuration" -bash -c "./Update-conf.py" -exitStatus=$? -if [ $exitStatus -ge 1 ]; then - echo -e $RED"\t* Configuration not up-to-date"$DEFAULT - exit -fi -echo -e $GREEN"\t* Configuration up-to-date"$DEFAULT - -screen -dmS "Script" -sleep 0.1 -echo -e $GREEN"\t* Launching ZMQ scripts"$DEFAULT - -screen -S "Script" -X screen -t "ModuleInformation" bash -c './ModulesInformationV2.py -k 0 -c 1; read x' -sleep 0.1 -screen -S "Script" -X screen -t "Mixer" bash -c './Mixer.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "Global" bash -c './Global.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "Duplicates" bash -c './Duplicates.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "Attributes" bash -c './Attributes.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "Lines" bash -c './Lines.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "DomClassifier" bash -c './DomClassifier.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "Categ" bash -c './Categ.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "Tokenize" bash -c './Tokenize.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "CreditCards" bash -c './CreditCards.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "Onion" bash -c './Onion.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "Mail" bash -c './Mail.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "Web" bash -c './Web.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "Credential" bash -c './Credential.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "Curve" bash -c './Curve.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "CurveManageTopSets" bash -c './CurveManageTopSets.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "RegexForTermsFrequency" bash -c './RegexForTermsFrequency.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "SetForTermsFrequency" bash -c './SetForTermsFrequency.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "Indexer" bash -c './Indexer.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "Keys" bash -c './Keys.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "Phone" bash -c './Phone.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "Release" bash -c './Release.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "Cve" bash -c './Cve.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "WebStats" bash -c './WebStats.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "ModuleStats" bash -c './ModuleStats.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "SQLInjectionDetection" bash -c './SQLInjectionDetection.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "alertHandler" bash -c './alertHandler.py; read x' -sleep 0.1 -screen -S "Script" -X screen -t "SentimentAnalysis" bash -c './SentimentAnalysis.py; read x'