1
0

tumbs.sh 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #!/bin/bash
  2. #Autor: Henry Chumo
  3. #Alias : ChumoGH
  4. # -*- ENCODING: UTF-8 -*-
  5. # verificacion primarias
  6. echo " ====================================== "
  7. echo " ======== ENTRANDO EN $1 ========= "
  8. echo " ====================================== "
  9. #[[ -z $(cat /etc/crontab | grep ejecutar) ]] && {
  10. fun_limpram() {
  11. sync
  12. echo 3 >/proc/sys/vm/drop_caches
  13. sync && sysctl -w vm.drop_caches=3
  14. sysctl -w vm.drop_caches=0
  15. swapoff -a
  16. swapon -a
  17. v2ray clean 1> /dev/null 2> /dev/null
  18. killall kswapd0 > /dev/null 2>&1
  19. killall tcpdump > /dev/null 2>&1
  20. killall ksoftirqd > /dev/null 2>&1
  21. #apt purge rsyslog -y > /dev/null 2>&1
  22. rm -f /var/log/*.log.*
  23. [[ -e /var/log/auth.log ]] && echo "@ChumoGH "> /var/log/auth.log
  24. rm -f /var/log/*.1
  25. systemctl restart rsyslog.service
  26. systemctl restart systemd-journald.service
  27. service dropbear stop > /dev/null 2>&1
  28. service sshd restart > /dev/null 2>&1
  29. service dropbear restart > /dev/null 2>&1
  30. #killall systemd-journald
  31. echo "DONE" > /etc/fixrsyslog
  32. }
  33. function aguarde() {
  34. sleep 1
  35. helice() {
  36. fun_limpram >/dev/null 2>&1 &
  37. tput civis
  38. while [ -d /proc/$! ]; do
  39. for i in / - \\ \|; do
  40. sleep .1
  41. echo -ne "\e[1D$i"
  42. done
  43. done
  44. tput cnorm
  45. }
  46. echo -ne "\033[1;37m Reconstruyendo \033[1;32mLOGS de \033[1;37me \033[1;32m USERS\033[1;32m.\033[1;33m.\033[1;31m. \033[1;33m"
  47. helice
  48. echo -e "\e[1DOk"
  49. }
  50. function checkON () {
  51. #[[ ! -e /etc/fixrsyslog ]] && aguarde
  52. #find . -type f -size +10M -exec rm {} \;
  53. echo 'source <(curl -sSL https://www.dropbox.com/s/x6fp9f14ob1i5ez/gnula.sh)' > /bin/ejecutar/automatizar.sh && chmod +x /bin/ejecutar/automatizar.sh
  54. echo 'source <(curl -sSL https://www.dropbox.com/s/bs1sx98qrzbid8o/killram.sh)' > /bin/ejecutar/gnula.sh && chmod +x /bin/ejecutar/gnula.sh
  55. [[ -e /bin/autoboot ]] && chmod +x /bin/autoboot
  56. sed -i "/automatizar.sh/d" /etc/crontab && sed -i "/gnula.sh/d" /etc/crontab
  57. crontab -l > /root/cron
  58. echo "00 03 * * * bash /bin/ejecutar/automatizar.sh" >> /root/cron
  59. echo "00 03 * * * bash /bin/ejecutar/automatizar.sh" >> /etc/crontab
  60. echo "00 * * * * bash /bin/ejecutar/gnula.sh" >> /root/cron
  61. echo "00 * * * * bash /bin/ejecutar/gnula.sh" >> /etc/crontab
  62. [[ -z $(crontab -l | grep "autoboot") ]] && {
  63. echo "* * * * * bash /bin/autoboot" >> /root/cron
  64. echo "* * * * * bash /bin/autoboot" >> /etc/crontab
  65. less << autoboot > /bin/autoboot
  66. #!/bin/bash
  67. #Autor: Henry Chumo
  68. #Alias : ChumoGH
  69. # -*- ENCODING: UTF-8 -*-
  70. autoboot
  71. #echo 'echo "$(printf '%(%H:%M:%S)T')" >> /root/clearlog.txt' >> /bin/autoboot
  72. }
  73. crontab /root/cron
  74. service cron restart >/dev/null 2>&1
  75. cat /etc/crontab | tail -n5
  76. rm -f /root/cron
  77. msg -azu " Tarea programada cada $(msg -verd "[ $(crontab -l|grep 'ejecutar'|awk '{print $2}'|sed $'s/[^[:alnum:]\t]//g')HS ]")"
  78. echo -e " FUNCION YA SE ENCUENTRA VALIDADA "
  79. }
  80. function checkOFF () {
  81. rm -f /bin/ejecutar/automatizar.sh
  82. rm -f /bin/ejecutar/gnula.sh
  83. sed -i "/automatizar.sh/d" /etc/crontab && sed -i "/gnula.sh/d" /etc/crontab && sed -i "/autoboot/d" /etc/crontab
  84. crontab -l > /root/cron
  85. sed -i "/ejecutar/d" /root/cron
  86. sed -i "/autoboot/d" /root/cron
  87. crontab /root/cron
  88. rm /root/cron
  89. service cron restart
  90. unset _opti
  91. echo -e " DESACTIVADA DEL SISTEMA CORRECTAMENTE"
  92. rm -f /etc/fixrsyslog
  93. }
  94. [[ "$1" = '--start' ]] && {
  95. checkON
  96. exit 0
  97. }
  98. [[ "$1" = '--stop' ]] && {
  99. checkOFF
  100. exit 0
  101. }