-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathengine_z_restart
84 lines (53 loc) · 2.53 KB
/
engine_z_restart
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# starts usability space bot engine
# (still under development)
# ─────────────────────────────────
# prepare includes
# ─────────────────────────────────
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
if [ -z "$DONT_REDEPLOY" ] ; then
source "$SCRIPT_DIR/engine_redeploy_scripts"
fi
if [ -z "$DONT_CLS" ] && [ -z "$1" ] ; then
cls
fi
# ─────────────────────────────────
# restart
# ─────────────────────────────────
restart_1="0"
while [ "$restart_1" -ne "1" ] ; do
echo "Do you want to stop all current pm2 bots, and start a new set of pm2 bots as configured?"
echo " ● 1 — Yes, I want to stop all current pm2 bots, and start a new set of pm2 bots as configured."
echo "Enter 1 when ready..."
read restart_1
done
if [ "${restart_1}" -eq "1" ] ; then
restart_2="0"
while [ "$restart_2" -ne "1" ] ; do
echo "THIS WILL STOP ALL BOTS RUNNING NOW!!!"
echo "Do you really want to stop all current pm2 bots, and start a new set of pm2 bots as configured?"
echo "IF YOU'RE NOT SURE, WE STRONGLY RECOMMEND YOU TO CONTACT THE ADMIM!!!"
echo " ● 1 — Yes, I really want to stop all current pm2 bots, and start a new set of pm2 bots as configured. AND I UNDERSTAND WHAT I DO."
echo "Enter 1 when ready..."
read restart_2
done
if [ "${restart_2}" -eq "1" ] ; then
echo "OK. Bot engine is now going to be restarted"
echo "Stopping all currently running pm2 bots..."
pm2 stop all
echo "All pm2 bots has been stopped."
echo "Deleting all currently running pm2 bots..."
pm2 delete all
echo "All pm2 bots has been deleted."
echo "Now trying to start a new set of pm2 bots as configured..."
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
source "$SCRIPT_DIR/engine_z_start"
echo "The try to start the new configured set of pm2 bots has finished."
echo "See for absense of errors above to check if the starting process has been successful."
echo "◼︎"
fi
fi
# ─────────────────────────────────
# finish
# ─────────────────────────────────
# cd $curdir # OF NO NEED
# must do nothing else ■