Super-quick-and-dirty hack which checks on MacOS if my local MPAD instance is still running. In case of failure, a message notification will be dispatched to the user's local account via osascript / MacOS Message Center.
- clone repository
- rename
mpad-watcher.yml.TEMPLATE
tompad-watcher.yml
. Then use the Apprise documentation and create a YAML file for the messengers that you want to support. You can specify a different filename by using the program's--configfile
parameter. - copy
watcher.sh.TEMPLATE
towatcher.sh
chmod u+x watcher.sh
- edit
watcher.sh
:- add your
aprs.fi
API key to variableMPAD_WATCHER_API_KEY
- Check script assumes a program crash if (
systime
-last heard on aprs.fi
) > 90 (minutes). You can change this value by specifying the--ttl_alert_after
value in minutes - amend the path for the repo's location (
cd /path/to/mpad-watcher
) - save file
- add your
- open Apple's ScriptEditor
- amend the path to the
watcher.sh
script - change the
timerInterval
value, if necessary. Default is 3600 secs = 60 min - save the script as is for further references
- Then save the file as an application (
File
->Export
-> File Format:Application
)
- amend the path to the
- In the Finder, locate the application that you have just created
- Right Mouse Button -> 'Show Package Contents'
- Edit
Contents/Info.plist
:
Your current Info.plist will look like this
<key>CFBundleSignature</key>
<string>aplt</string>
<key>LSMinimumSystemVersionByArchitecture</key>
<dict>
<key>x86_64</key>
<string>10.6</string>
</dict>
<key>LSRequiresCarbon</key>
<true/>
Now add these two entries - this change will prevent the application from adding an icon to the MacOS dock:
<key>LSUIElement</key>
<true/>
Final result will look like this:
<key>CFBundleSignature</key>
<string>aplt</string>
<key>LSMinimumSystemVersionByArchitecture</key>
<dict>
<key>x86_64</key>
<string>10.6</string>
</dict>
<key>LSRequiresCarbon</key>
<true/>
<key>LSUIElement</key>
<true/>
- save the file
- END of configuration steps
- Double-click the application. If all works well (e.g. correct API key et al), you should not receive any message (but the application still keeps on running per MacOS's Activity monitor)\
- You can now add this application as a MacOS login item.