Sequoia - Run Shell Script stopped working?

Hello,

I have a shell script with a simple one-line curl command that worked fine every day until I updated to Sequoia. It now stopped working, but is not giving any errors. I tried redirecting output to a window and to the clipboard, and I'm getting nothing at all. This is when invoked explicitly, both the whole macro and also just the one action via "Try".

Does anyone have any ideas?

Thank you!

I have some ideas. In the shell script action pull the cogwheel menu from the upper right and try selecting "include errors". You might see an error message.

Another idea is to try the command from a Terminal window and see any errors more directly.

Thank you for replying so quickly!

The script runs fine from the shell. Just for reference, this si the whole entire script:

#!/bin/bash
curl -X POST "192.168.86.41/number/target_desk_height/set?value=40.5" -H "Content-Length: 0"⏎

And the file has +x perms. So when I run it from the terminal, it just works.

I enabled errors in KM and when I run it via KM I still get nothing at all... Any other ideas?

I'm not sure if this is a case of requiring permissions. KM is finicky and sometimes macOS takes away a permission that it needs and you have to restore it.

There's still one more thing you should try, because it's not clear to me if it doesn't work or if the action fails. If the action is failing, you can see an error in the KM Engine Log file. You can get to it from the KM Editor under the Help / Open Logs folder. Check for an error at the exact time it supposedly ran. (Probably best to run it again to note the time and then check the log, which can grow quickly.)

If there is an error, let me know the text of the error. If not, let's cross that bridge later.

This may seem like a longshot, but that character in your file might be a problem. If it's the wrong type of newline it may cause the script to fail. Try removing it.

1 Like

Always worth trying something simple for testing purposes:

image

If that doesn't work, have a dig through System Settings->Privacy & Security to see if a KM permission needs re-enabling.

1 Like

That's it! That was a breakthrough. I got this now:

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (7) Failed to connect to 192.168.86.41 port 80 after 1 ms: Couldn't connect to server
yo

So for some reason, Keyboard Maestro can't make network requests.

I went to System prefs -> Privacy & Security -> Local Network, found Keyboard Maestro, and enabled it. Ta-da, my macros work again! Thank you so much!

1 Like