-
Notifications
You must be signed in to change notification settings - Fork 0
/
run
114 lines (93 loc) · 2.17 KB
/
run
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/bin/bash
# Skrypt stworzony przez Stalker
# Zakaz kopiowania, sprzedawania oraz wykorzystywania do swoich aplikacji
# Ts: Jutuby.Net
function greenMessage {
echo -e "\\033[32;1m${@}\033[0m"
}
function redMessage {
echo -e "\\033[31;1m${@}\033[0m"
}
function yellowMessage {
echo -e "\\033[33;1m${@}\033[0m"
}
function blueMessage {
echo -e "\\033[34;1m${@}\033[0m"
}
if [ "$1" == "start" ];
then
echo -e '\033[33mStarting!'
for (( i=1; $i <= 1; i++ )) ; do
if screen -ls | grep -q vpnDetector;
then
sleep 0.3
redMessage " - bot is already started!"
else
screen -AdmS vpnDetector php bot.php
sleep 0.3
if screen -ls | grep -q vpnDetector;
then
sleep 0.00001
else
redMessage " - bot was not started! Check the config file!"
fi
fi
done
echo -e '\033[0m'
elif [ "$1" == "stop" ];
then
if screen -ls | grep -q daemon;
then
redMessage "Firt turn off daemon!"
else
echo -e '\033[33mStopping!\033[0m'
for (( i=1; $i <= 1; i++ )) ; do
if screen -ls | grep -q vpnDetector;
then
screen -X -S vpnDetector quit
else
redMessage " - bot is already started! ($i)"
fi
sleep 0.3
done
fi
####################
elif [ "$1" == "daemon" ];
then
if screen -ls | grep -q daemon;
then
screen -X -S daemon quit
screen -X -S vpnDetector quit
redMessage 'Stopping daemon!'
else
screen -AdmS daemon ./run check
greenMessage "Starting daemon!"
fi
elif [ "$1" == "check" ];
then
while [ true ] ; do
for (( i=1; $i <= 1; i++ )) ; do
if screen -ls | grep -q vpnDetector;
then
sleep 0.2
greenMessage " - bot is already started!"
else
screen -AdmS vpnDetector php bot.php
sleep 1
if screen -ls | grep -q vpnDetector;
then
sleep 0.2
else
redMessage " - error"
fi
fi
done
echo -e '\033[0m'
sleep 3
done
else
redMessage 'Usage: run start/stop/restart/daemon'
fi
#Script created by Stalker
#Copying is forbidden
#Ts: Jutuby.Net