I am trying to set up KM to test if Internet Sharing is turned on, and if it isn't to enable it. I've found a script that turns Internet Sharing on, but I can't find any way to get the status of IS without launching System Preferences.
I only want to launch System Preferences if IS needs to be turned on, Is this possible?
However if Internet Sharing has never been enabled, you won’t get either result, but will instead get an error message.
Since you are looking for “Is It On or Not?” then you can basically just look for a result of 1 because if you get the error message, then it was not configured, so therefore it’s obviously/logically not enabled.
I’ve made a basic macro which runs a script and returns “success” if Internet Sharing is ON. It uses an ‘Else’ to check, and the only actions are a notification telling you which condition is currently active.