-
Notifications
You must be signed in to change notification settings - Fork 3
/
autokill.sh
95 lines (94 loc) · 3.59 KB
/
autokill.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
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
#!/bin/bash
red='\e[1;31m'
green='\e[0;32m'
NC='\e[0m'
MYIP=$(wget -qO- icanhazip.com);
echo "Checking VPS"
Green_font_prefix="\033[32m" && Red_font_prefix="\033[31m" && Green_background_prefix="\033[42;37m" && Red_background_prefix="\033[41;37m" && Font_color_suffix="\033[0m"
Info="${Green_font_prefix}[ON]${Font_color_suffix}"
Error="${Red_font_prefix}[OFF]${Font_color_suffix}"
cek=$(grep -c -E "^# Autokill" /etc/cron.d/tendang)
if [[ "$cek" = "1" ]]; then
sts="${Info}"
else
sts="${Error}"
fi
clear
echo -e ""
echo -e "======================================"
echo -e ""
echo -e " Status Autokill $sts "
echo -e ""
echo -e " [1] AutoKill After 5 Minutes"
echo -e " [2] AutoKill After 10 Minutes"
echo -e " [3] AutoKill After 15 Minutes"
echo -e " [4] Turn Off AutoKill/MultiLogin"
echo -e " [0] Exit To Menu"
echo -e "======================================"
echo -e ""
read -p " Select From Options [1-4 or x] : " AutoKill
read -p " Multilogin Maximum Number Of Allowed: " max
echo -e ""
case $AutoKill in
1)
echo -e ""
sleep 1
clear
echo > /etc/cron.d/tendang
echo "# Autokill" >>/etc/cron.d/tendang
echo "*/5 * * * * root /usr/bin/tendang $max" >>/etc/cron.d/tendang
echo -e ""
echo -e "======================================"
echo -e ""
echo -e " Allowed MultiLogin : $max"
echo -e " AutoKill Every : 5 Minutes"
echo -e ""
echo -e "======================================"
;;
2)
echo -e ""
sleep 1
clear
echo > /etc/cron.d/tendang
echo "# Autokill" >>/etc/cron.d/tendang
echo "*/10 * * * * root /usr/bin/tendang $max" >>/etc/cron.d/tendang
echo -e ""
echo -e "======================================"
echo -e ""
echo -e " Allowed MultiLogin : $max"
echo -e " AutoKill Every : 10 Minutes"
echo -e ""
echo -e "======================================"
;;
3)
echo -e ""
sleep 1
clear
echo > /etc/cron.d/tendang
echo "# Autokill" >>/etc/cron.d/tendang
echo "*/15 * * * * root /usr/bin/tendang $max" >>/etc/cron.d/tendang
echo -e ""
echo -e "======================================"
echo -e ""
echo -e " Allowed MultiLogin : $max"
echo -e " AutoKill Every : 15 Minutes"
echo -e ""
echo -e "======================================"
;;
4)
clear
echo > /etc/cron.d/tendang
echo -e ""
echo -e "======================================"
echo -e ""
echo -e " AutoKill MultiLogin Turned Off "
echo -e ""
echo -e "======================================"
;;
0)
menu
clear
;;
esac
read -n 1 -s -r -p "Press any key to back on menu"
menu