-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
run.sh
28 lines (23 loc) · 800 Bytes
/
run.sh
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
#!/usr/bin/bash
# /$$$$$$$ /$$ /$$ /$$
# | $$__ $$ |__/| $$ | $$
# | $$ \ $$ /$$$$$$ /$$$$$$ /$$| $$$$$$$ /$$$$$$ /$$$$$$
# | $$$$$$$//$$__ $$ /$$__ $$| $$| $$__ $$ /$$__ $$|_ $$_/
# | $$____/| $$$$$$$$| $$ \__/| $$| $$ \ $$| $$ \ $$ | $$
# | $$ | $$_____/| $$ | $$| $$ | $$| $$ | $$ | $$ /$$
# | $$ | $$$$$$$| $$ | $$| $$$$$$$/| $$$$$$/ | $$$$/
# |__/ \_______/|__/ |__/|_______/ \______/ \___/
FAILS=0
while true
do
sleep 0.5
python3 main.py # your program
EXIT=$?
((FAILS ))
if [[ $FAILS -gt 10 ]]
then
echo "[$(date)] failed to many times. aborting ..."
exit 1
fi
echo "[$(date)] bot exited with code $EXIT. restarting ..."
done