autokill.sh 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #!/bin/bash
  2. red='\e[1;31m'
  3. green='\e[0;32m'
  4. NC='\e[0m'
  5. MYIP=$(wget -qO- icanhazip.com);
  6. echo "Checking VPS"
  7. clear
  8. 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"
  9. Info="${Green_font_prefix}[ON]${Font_color_suffix}"
  10. Error="${Red_font_prefix}[OFF]${Font_color_suffix}"
  11. cek=$(grep -c -E "^# Autokill" /etc/cron.d/tendang)
  12. if [[ "$cek" = "1" ]]; then
  13. sts="${Info}"
  14. else
  15. sts="${Error}"
  16. fi
  17. clear
  18. echo -e ""
  19. echo -e "======================================"
  20. echo -e ""
  21. echo -e " Status Autokill $sts "
  22. echo -e ""
  23. echo -e " [1] AutoKill After 5 Minutes"
  24. echo -e " [2] AutoKill After 10 Minutes"
  25. echo -e " [3] AutoKill After 15 Minutes"
  26. echo -e " [4] Turn Off AutoKill/MultiLogin"
  27. echo -e " [x] Exit"
  28. echo -e "======================================"
  29. echo -e ""
  30. read -p " Select From Options [1-4 or x] : " AutoKill
  31. read -p " Multilogin Maximum Number Of Allowed: " max
  32. echo -e ""
  33. case $AutoKill in
  34. 1)
  35. echo -e ""
  36. sleep 1
  37. clear
  38. echo > /etc/cron.d/tendang
  39. echo "# Autokill" >>/etc/cron.d/tendang
  40. echo "*/5 * * * * root /usr/bin/tendang $max" >>/etc/cron.d/tendang
  41. echo -e ""
  42. echo -e "======================================"
  43. echo -e ""
  44. echo -e " Allowed MultiLogin : $max"
  45. echo -e " AutoKill Every : 5 Minutes"
  46. echo -e ""
  47. echo -e "======================================"
  48. exit
  49. [ $MYIP = $MYIP ];;
  50. 2)
  51. echo -e ""
  52. sleep 1
  53. clear
  54. echo > /etc/cron.d/tendang
  55. echo "# Autokill" >>/etc/cron.d/tendang
  56. echo "*/10 * * * * root /usr/bin/tendang $max" >>/etc/cron.d/tendang
  57. echo -e ""
  58. echo -e "======================================"
  59. echo -e ""
  60. echo -e " Allowed MultiLogin : $max"
  61. echo -e " AutoKill Every : 10 Minutes"
  62. echo -e ""
  63. echo -e "======================================"
  64. exit
  65. [ $MYIP = $MYIP ];;
  66. 3)
  67. echo -e ""
  68. sleep 1
  69. clear
  70. echo > /etc/cron.d/tendang
  71. echo "# Autokill" >>/etc/cron.d/tendang
  72. echo "*/15 * * * * root /usr/bin/tendang $max" >>/etc/cron.d/tendang
  73. echo -e ""
  74. echo -e "======================================"
  75. echo -e ""
  76. echo -e " Allowed MultiLogin : $max"
  77. echo -e " AutoKill Every : 15 Minutes"
  78. echo -e ""
  79. echo -e "======================================"
  80. exit
  81. [ $MYIP = $MYIP ];;
  82. 4)
  83. clear
  84. echo > /etc/cron.d/tendang
  85. echo -e ""
  86. echo -e "======================================"
  87. echo -e ""
  88. echo -e " AutoKill MultiLogin Turned Off "
  89. echo -e ""
  90. echo -e "======================================"
  91. exit
  92. [ $MYIP = $MYIP ];;
  93. x)
  94. clear
  95. exit
  96. [ $MYIP = $MYIP ];;
  97. esac