root3nl / SupportApp

The Support App is developed by Root3, specialized in managing Apple devices. Root3 offers consultancy and support for organizations to get the most out of their Apple devices and is based in The Netherlands (Halfweg).
https://www.root3.nl
MIT License
589 stars 62 forks source link

Unable to Execute Command #31

Open silentArtifact opened 3 years ago

silentArtifact commented 3 years ago

I seem to be unable to get support to run terminal commands. I've tried to get it to call up IBM Notifier as a "hello world" test, and it definitely seems to run (beachball pops up briefly), but then nothing happens. It's set to command, with the following in the link value:

/Applications/IBM\ Notifier.app/Contents/MacOS/IBM\ Notifier -type popup -bar_title "Test" -subtitle "Test"

Not sure where I'm going wrong.

andredb90 commented 2 years ago

Wondering if you had any luck fixing this?

I'm experiencing the same issue. Running a simple command such as open -a Safari works as expected. But I'm trying to trigger our MDM client and it fails. (even though the same command being run as the current user via Terminal succeeds)

silentArtifact commented 2 years ago

No luck so far. We've put it on hold for the moment.

andredb90 commented 2 years ago

Thanks for the quick reply!

hmm.. tried to give it Full Access, too.. but no cigar. Guess we'll have to wait until the developers chime in.

I know someone who's created a simple automator app which runs an Apple Script. Calling the script by opening the app instead of running the command seems to work.

the-monger commented 2 years ago

Similar issue- I have buttons that will open apps fine, but when it comes to running a script, it gets weird. It will run a script first time, no problems. If I hit the button to run it again, the script output changes (incorrectly, I might add. For example- if I have a script that runs "fdesetup status | head -n 1" it will correctly report filevault on; if I run it again, it will say it's off. Uses an AppleScript popup to return the info). If I edit the script, nothing changes. Eventually, the script will stop being recognized at all.

Script is in /Library/Application Support/MDM/Scripts. Script is executable

the-monger commented 2 years ago

Can also confirm the automator workaround

martinwen1990 commented 2 years ago

Can we maybe see several examples of commands or scripts that are entered in the config profile? We also currently have a problem calling a script in the support app. Thank you very much.

sidbena commented 2 years ago

I'm also having issues with this. I've tried assigning a command in the form of /path/to/script.file with or without arguments, /path/to/binary arg1 arg2 and <shell built-in> arg1 arg2, but none of them work. If I repeatedly click the button in the app, the app says ”An error occurred". How is this supposed to work? Are there any logs? Thanks!

jordywitteman commented 2 years ago

Please note the current implementation of running scripts/commands is running in the user space because the app is sandboxed, so the script is probably not reachable or requires elevated privileges.

We are working on an (optional) helper utility to allow running scripts/commands with elevated privileges because we don't want to break out of the sandbox for security reasons. A beta will probably be released before the end of next week :)

sidbena commented 2 years ago

The specific code I'm trying to run requires no elevation how ever. Is there any logging or such?

Sounds good about the utility though, and nice that it's optional.

meta-github commented 2 years ago

I just have seen the new beta, thanks a lot! Is the SupportHelper app available as well?

jordywitteman commented 2 years ago

Hi @meta-github yes it's in the pre-release assets for the 2.4 beta:

Documentation: https://github.com/root3nl/SupportApp/tree/development SupportHelper download: https://github.com/root3nl/SupportApp/releases/tag/v2.4-beta

bradtchapman commented 1 year ago

I think this issue can be closed now that SupportHelper is available. Yes?