0

Without proper verification I used the code generated by ChatGPT, thinking that I would set up my Mac for automatic rebooting every hour. The commands here are quite simple, and someone knowledgeable should understand this. I just want to know what has happened to my MacBook now after all of this because I was using it via remote access with AnyDesk, and it's not responding. Can you explain what the code did with it? The code is here:

nano ~/reboot_hourly.sh
#!/bin/bash
sudo shutdown -r now
chmod +x ~/reboot_hourly.sh
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.myreboot</string>
    <key>Program</key>
    <string>/Users/your_username/reboot_hourly.sh</string>
    <key>StartInterval</key>
    <integer>3600</integer>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>
sudo launchctl load /Library/LaunchDaemons/com.myreboot.plist

I did nothing because I don't have an acsess to my Mac right now, I just want an explanation of this code and is this in endless rebooting cycle right now or what?

3
  • Do not delete and repost questions literally if they have been closed. And don’t even create a new account for that. Edit and improve the question.I wrote a comment to your deleted question about issues in the code. Commented Oct 4, 2023 at 7:27
  • The platform suggested me to repost the question, sorry, I just need the explanation did this code put my PC in Endless reboot loop or not Commented Oct 4, 2023 at 7:29
  • It depends on a few things beyond the code. Commented Oct 4, 2023 at 7:33

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.