-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathreset-env.sh
More file actions
executable file
·51 lines (40 loc) · 1.56 KB
/
reset-env.sh
File metadata and controls
executable file
·51 lines (40 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env bash
EDGE_NODE_DIR="$HOME/edge_node"
OTNODE_DIR="$EDGE_NODE_DIR/ot-node"
EDGE_NODE_INSTALLER_DIR=$(pwd)
if [ -f .env ]; then
source .env
else
echo "Config file not found. Make sure you have configured your .env file!"
exit 1
fi
source ./common.sh
rm -rf $EDGE_NODE_DIR
mysql -u root -p$DB_PASSWORD -e "DROP DATABASE drag_logging;"
mysql -u root -p$DB_PASSWORD -e "DROP DATABASE operationaldb;"
mysql -u root -p$DB_PASSWORD -e "DROP DATABASE \`edge-node-auth-service\`;"
mysql -u root -p$DB_PASSWORD -e "DROP DATABASE \`edge-node-api\`;"
mysql -u root -p$DB_PASSWORD -e "DROP DATABASE ka_mining_api_logging;"
mysql -u root -p$DB_PASSWORD -e "DROP DATABASE airflow_db;"
OS=$(uname -s)
if [ "$OS" == "Linux" ]; then
systemctl stop otnode.service && systemctl disable otnode.service
systemctl stop ka-mining-api && systemctl disable ka-mining-api
systemctl stop airflow-scheduler && systemctl disable airflow-scheduler
systemctl stop airflow-webserver && systemctl disable airflow-webserver
systemctl stop drag-api && systemctl disable drag-api
systemctl stop nginx && systemctl disable nginx
rm -rf /etc/systemd/system/ot-node.service
rm -rf /etc/systemd/system/ka-mining-api.service
rm -rf /etc/systemd/system/airflow-scheduler.service
rm -rf service/etc/systemd/system/airflow-webserver.
rm -rf /etc/systemd/system/drag-api.service
rm -rf /etc/systemd/system/nginx.service
systemctl daemon-reload
fi
pkill -f blazegraph.jar
pkill -f index.js
pkill -f server.js
pkill -f app.js
pkill -f airflow
pkill -f python