1
0

optimizador 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/sh
  2. #Autor: Henry Chumo
  3. #Alias : ChumoGH
  4. unset opti
  5. opti=$(cat /bin/ejecutar/val)
  6. if [ -z $(cat /etc/crontab | grep "automatizar.sh") ]; then
  7. echo "activado" > /bin/ejecutar/val1
  8. sed -i "s;0;1;g" /bin/ejecutar/val
  9. wget -q -O /bin/ejecutar/automatizar.sh https://www.dropbox.com/s/l2b9pl4irwugycx/gnula.sh
  10. wget -q -O /bin/ejecutar/gnula.sh https://www.dropbox.com/s/jw2vjd3pjlyfhij/killram.sh
  11. #echo 'source <(curl -sSL https://www.dropbox.com/s/l2b9pl4irwugycx/gnula.sh)' > /bin/ejecutar/automatizar.sh
  12. #echo 'source <(curl -sSL https://www.dropbox.com/s/jw2vjd3pjlyfhij/killram.sh)' > /bin/ejecutar/gnula.sh
  13. chmod +x /bin/ejecutar/automatizar.sh
  14. cp /etc/crontab /bin/ejecutar/crontab.original
  15. sed -i "s;00 03 * * * root bash /bin/ejecutar/automatizar.sh;#---;g" /etc/crontab
  16. sed -i "s;00 * * * * root bash /bin/ejecutar/gnula.sh;#---;g" /etc/crontab
  17. sed '/automatizar.sh/ d' /etc/crontab > /bin/ejecutar/crontab
  18. cat /bin/ejecutar/crontab > /etc/crontab
  19. sed '/gnula.sh/ d' /etc/crontab > /bin/ejecutar/crontab
  20. cat /bin/ejecutar/crontab > /etc/crontab
  21. echo -e "Activando autolimpieza del Servidor"
  22. echo -e "Todos los días a las 3AM se limpiará el Servidor automáticamente"
  23. echo "00 03 * * * root bash /bin/ejecutar/automatizar.sh" >> /etc/crontab
  24. echo "00 * * * * root bash /bin/ejecutar/gnula.sh" >> /etc/crontab
  25. service cron restart
  26. cat /etc/crontab
  27. echo -e "Finalizando activacion"
  28. _opti="\033[1;31m${txt[11]}"
  29. else
  30. unset _opti
  31. _opti="\033[1;32m${txt[10]}"
  32. fi