autoreboot.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/bash
  2. red='\e[1;31m'
  3. green='\e[0;32m'
  4. NC='\e[0m'
  5. MYIP=$(wget -qO- ipinfo.io/ip);
  6. IZIN=$( curl https://raw.githubusercontent.com/alifnurmareta/premium/main/iptext.sh | grep $MYIP )
  7. if [ $MYIP = $IZIN ]; then
  8. clear
  9. echo -e "${green} Please Wait, Proses...${NC}"
  10. sleep 5
  11. else
  12. echo "User premium Only ,Sila Contact Admin Bot😘"
  13. exit 0
  14. fi
  15. clear
  16. echo -e ""
  17. echo -e "------------------------------------" | lolcat
  18. echo -e " AUTO REBOOT"
  19. echo -e "------------------------------------" | lolcat
  20. echo -e ""
  21. echo -e " 1) Auto Reboot 30 minutes"
  22. echo -e " 2) Auto Reboot 1 Hours"
  23. echo -e " 3) Auto Reboot 12 Hours"
  24. echo -e " 4) Auto Reboot 24 Hours"
  25. echo -e " 5) Auto Reboot 1 weeks"
  26. echo -e " 6) Auto Reboot 1 mount"
  27. echo -e ""
  28. echo -e "------------------------------------" | lolcat
  29. echo -e " x) MENU"
  30. echo -e "------------------------------------" | lolcat
  31. echo -e ""
  32. read -p " Please Input Number [1-6 or x] : " autoreboot
  33. echo -e ""
  34. case $autoreboot in
  35. 1)
  36. echo "*/30 * * * * root /usr/bin/reboot" > /etc/cron.d/auto_reboot && chmod +x /etc/cron.d/auto_reboot
  37. ;;
  38. 2)
  39. echo "0 * * * * root /usr/bin/reboot" > /etc/cron.d/auto_reboot && chmod +x /etc/cron.d/auto_reboot
  40. ;;
  41. 3)
  42. echo "0 */12 * * * root /usr/bin/reboot" > /etc/cron.d/auto_reboot && chmod +x /etc/cron.d/auto_reboot
  43. ;;
  44. 4)
  45. echo "0 0 * * * root /usr/bin/reboot" > /etc/cron.d/auto_reboot && chmod +x /etc/cron.d/auto_reboot
  46. ;;
  47. 5)
  48. echo "0 0 */7 * * root /usr/bin/reboot" > /etc/cron.d/auto_reboot && chmod +x /etc/cron.d/auto_reboot
  49. ;;
  50. 6)
  51. echo "0 0 1 * * root /usr/bin/reboot" > /etc/cron.d/auto_reboot && chmod +x /etc/cron.d/auto_reboot
  52. ;;
  53. x)
  54. menu
  55. ;;
  56. *)
  57. echo "Please enter an correct number"
  58. ;;
  59. esac