Apple’s Worldwide Developers Conference to kick off June 10 at 10 a.m. PDT with Keynote address

The Keynote will be available to stream on apple.com, the Apple Developer app, the Apple TV app, and the Apple YouTube channel. On-demand playback will be available after the conclusion of the stream.

Developer Forums relocated!

Need help with Apple Developer tools and technologies? Want to share information with other developers and Apple engineers? Visit Developer Forums at Apple.

Stopping apple script on restart

My script repeats a bash file every thirty minutes, but I also have my iMac scheduled to restart everyday.


The restart isn't able to kill the script so it's stuck.


How can I alter the script to allow it to be killed for restart? I tried adding the suggested on quit but Control-Q doesn't even work.


#!/bin/bash

repeat

do shell script "bash /Users/robby/.homebridge/hbrestart.sh"

delay 1800

end repeat

on quit

continue quit

end quit

iMac 21.5″, macOS 10.13

Posted on May 1, 2024 8:13 AM

Reply
5 replies

May 1, 2024 9:03 AM in response to h00pak

h00pak wrote:

If you'll help me with an example of what the plist should look like, I'll compare that against what I'd already tried with launchd and wasn't working. I just need it to use StartInterval.

That's how I got to the script in the first place. I know, I know, you didn't think to ask that, but there you go.


I use Lingon:


Docs:


More examples:


There are other exampkes around but, as stated, I use Lingon.


ASC is munging and munching links again today, so please excuse the above work-around.

May 1, 2024 8:50 AM in response to MrHoffman

If you'll help me with an example of what the plist should look like, I'll compare that against what I'd already tried with launchd and wasn't working. I just need it to use StartInterval.


That's how I got to the script in the first place. I know, I know, you didn't think to ask that, but there you go.


Thanks.

Stopping apple script on restart

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.