Skip to content

Commit

Permalink
chg: [launcher] Adding install and launcher scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
airkeyp committed Sep 26, 2019
1 parent 3844908 commit 7447bda
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.idea/
ipa.egg-info/
ipa.egg-info/
.venv
db/
22 changes: 22 additions & 0 deletions analyzer_launch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

if [ -e "${DIR}/.venv/bin/python" ]; then
ENV_PY="${DIR}/.venv/bin/python"
else
echo "Please make sure you ran install.sh first."
exit 1
fi

if [ ! -d "${DIR}/db" ]; then
mkdir db
fi

screen -dmS "ipa"
sleep 0.1

screen -S "ipa" -X screen -t "ipa-redis" bash -c "(redis-server ${DIR}/etc/redis.conf); read x;"
screen -S "ipa" -X screen -t "ipa-d4" bash -c "(cd bin; ${ENV_PY} ./run_ipa.py; read x;)"

exit 0
4 changes: 4 additions & 0 deletions bin/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ def export_icmp_types():
for key in redis_dict:
res += mds.table_row([key.decode(), redis_dict[key].decode()], [10, 10]) + '\n'
return res


if __name__ == "__main__":
export_icmp_types()
2 changes: 1 addition & 1 deletion etc/redis.conf
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ dbfilename dump.rdb
# The Append Only File will also be created inside this directory.
#
# Note that you must specify a directory here, not a file name.
dir ../db
dir ./db

################################# REPLICATION #################################

Expand Down
12 changes: 12 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -e
set -x

export PIPENV_VENV_IN_PROJECT=1

if [ -z "$VIRTUAL_ENV" ]; then
pipenv install
export IPA_HOME=$(pwd)
fi

0 comments on commit 7447bda

Please sign in to comment.