Zorus / ZorusDeploymentScripts

This repository contains scripts to help out with agent deployments.
2 stars 4 forks source link

Fixed credential read issue in MacOS Forced Reinstall script #14

Closed koilosa closed 5 months ago

koilosa commented 5 months ago

Update ForcedReinstall.zsh to add quotes around credential file variable on line 58 - was causing cat to incorrectly parse the credentials file path

puntor commented 5 months ago

Hello @koilosa,

Thank you for your submission. I have approved the request, as the proposed changes appear to work as expected. However, I have tested the existing script and the new one with your proposed changes and they both seem to work when launching through a standard terminal.

Is there any special configuration of macOS you're running, or any specific mechanism you're using to launch this script (say through an RMM tool) that you can provide us? This would greatly help us test future changes or new scripts to ensure compatibility.

Thanks, Frank

koilosa commented 5 months ago

Hi Frank (@puntor),

I tested on MacOS 14.4.1 via Addigy MDM's script feature in the go-live view.

FWIW it seems to run fine on my machine without the double quotes when I run it as a script so maybe just a quirk of Addigy?

Edit - this is the exact output I get from the script history in Addigy, so it looks to me that cat is taking the path as two separate arguments separated by a space

cat: Support/Zorus,: No such file or directory
cat: Inc/Settings/credentials.json: No such file or directory
execution error: Error: SyntaxError: JSON Parse error: Unexpected EOF (-2700)
Found Zorus Deployment Token .
puntor commented 5 months ago

Definitely seems like an Addigy quirk. I wonder if this is due to a problem with parsing variables on the Addigy side or just something with how they're launching the scripts through zsh. 🤷‍♂️

Thanks again for the fix, we'll try our best to check for compatibility with Addigy (specifically that script feature) with future scripts prior to releasing them.