botssh 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #!/bin/bash
  2. clear
  3. fun_bar() {
  4. comando[0]="$1"
  5. comando[1]="$2"
  6. (
  7. [[ -e $HOME/fim ]] && rm $HOME/fim
  8. ${comando[0]} -y >/dev/null 2>&1
  9. ${comando[1]} -y >/dev/null 2>&1
  10. touch $HOME/fim
  11. ) >/dev/null 2>&1 &
  12. tput civis
  13. echo -ne "\033[1;33m["
  14. while true; do
  15. for ((i = 0; i < 18; i++)); do
  16. echo -ne "\033[1;31m#"
  17. sleep 0.1s
  18. done
  19. [[ -e $HOME/fim ]] && rm $HOME/fim && break
  20. echo -e "\033[1;33m]"
  21. sleep 1s
  22. tput cuu1
  23. tput dl1
  24. echo -ne "\033[1;33m["
  25. done
  26. echo -e "\033[1;33m]\033[1;37m -\033[1;32m OK !\033[1;37m"
  27. tput cnorm
  28. }
  29. fun_botOnOff() {
  30. [[ $(ps x | grep "bot_plus" | grep -v grep | wc -l) = '0' ]] && {
  31. clear
  32. echo -e "\E[44;1;37m INSTALADOR BOT SSH \E[0m\n"
  33. echo -ne "\033[1;32mINFORME SEU TOKEN:\033[1;37m "
  34. read tokenbot
  35. echo ""
  36. echo -ne "\033[1;32mINFORME SEU ID:\033[1;37m "
  37. read iduser
  38. clear
  39. echo -e "\033[1;32mINICIANDO BOT SSHPLUS \033[0m\n"
  40. fun_bot1() {
  41. [[ "$(grep -wc '16' /etc/issue.net)" != '0' ]] && {
  42. wget -qO- https://raw.githubusercontent.com/modderajuda/donomodderajuda/main/I/ShellBot.sh > /etc/SSHPlus/ShellBot.sh
  43. }
  44. [[ ! -e "/etc/SSHPlus/ShellBot.sh" ]] && {
  45. wget -qO- https://raw.githubusercontent.com/modderajuda/donomodderajuda/main/I/ShellBot.sh >/etc/SSHPlus/ShellBot.sh
  46. }
  47. cd /etc/SSHPlus
  48. screen -dmS bot_plus ./bot $tokenbot $iduser >/dev/null 2>&1
  49. [[ $(grep -wc "bot_plus" /etc/autostart) = '0' ]] && {
  50. echo -e "ps x | grep 'bot_plus' | grep -v 'grep' || cd /etc/SSHPlus && sudo screen -dmS bot_plus ./bot $tokenbot $iduser && cd $HOME" >>/etc/autostart
  51. } || {
  52. sed -i '/bot_plus/d' /etc/autostart
  53. echo -e "ps x | grep 'bot_plus' | grep -v 'grep' || cd /etc/SSHPlus && sudo screen -dmS bot_plus ./bot $tokenbot $iduser && cd $HOME" >>/etc/autostart
  54. }
  55. [[ $(crontab -l | grep -c "verifbot") = '0' ]] && (
  56. crontab -l 2>/dev/null
  57. echo "@daily /bin/verifbot"
  58. ) | crontab -
  59. cd $HOME
  60. }
  61. fun_bar 'fun_bot1'
  62. [[ $(ps x | grep "bot_plus" | grep -v grep | wc -l) != '0' ]] && echo -e "\n\033[1;32m BOT SSH ATIVADO !\033[0m" || echo -e "\n\033[1;31m ERRO! REANALISE SUAS INFORMACOES\033[0m"
  63. sleep 2
  64. menu
  65. } || {
  66. clear
  67. echo -e "\033[1;32mPARANDO SSH... \033[0m\n"
  68. fun_bot2() {
  69. screen -r -S "bot_plus" -X quit
  70. screen -wipe 1>/dev/null 2>/dev/null
  71. [[ $(grep -wc "bot_plus" /etc/autostart) != '0' ]] && {
  72. sed -i '/bot_plus/d' /etc/autostart
  73. }
  74. [[ $(crontab -l | grep -c "verifbot") != '0' ]] && crontab -l | grep -v 'verifbot' | crontab -
  75. sleep 1
  76. }
  77. fun_bar 'fun_bot2'
  78. echo -e "\n\033[1;32m \033[1;31mBOT SSH PARADO! \033[0m"
  79. sleep 2
  80. menu
  81. }
  82. }
  83. fun_instbot() {
  84. echo -e "\E[44;1;37m INSTALADOR BOT SSH \E[0m\n"
  85. echo -e " \033[1;33m[\033[1;31m!\033[1;33m] \033[1;31mATENÇÃO \033[1;33m[\033[1;31m!\033[1;33m]\033[0m"
  86. echo -e "\n\033[1;32m1° \033[1;37m- \033[1;33mPELO SEU TELEGRAM ACESSE OS SEGUINTES BOT\033[1;37m:\033[0m"
  87. echo -e "\n\033[1;32m2° \033[1;37m- \033[1;33mBOT \033[1;37m@BotFather \033[1;33mCRIE O SEU BOT \033[1;31mOPCAO: \033[1;37m/newbot\033[0m"
  88. echo -e "\n\033[1;32m3° \033[1;37m- \033[1;33mBOT \033[1;37m@@useridinfobot \033[1;33mE PEGUE SEU ID \033[1;31mOPCAO: \033[1;37m/id\033[0m"
  89. echo -e "\033[0;34m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\033[1;32m"
  90. echo ""
  91. read -p "DESEJA CONTINUAR ? [s/n]: " -e -i s resposta
  92. [[ "$resposta" = 's' ]] && {
  93. fun_botOnOff
  94. } || {
  95. echo -e "\n\033[1;31mRetornando...\033[0m"
  96. sleep 2
  97. menu
  98. }
  99. }
  100. [[ -f "/etc/SSHPlus/ShellBot.sh" ]] && fun_botOnOff || fun_instbot
  101. #fim