Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.github.ygini.hello-it.hostname.sh – always prints out ComputerName #64

Open
JoGilb opened this issue Mar 20, 2022 · 0 comments
Open

Comments

@JoGilb
Copy link

JoGilb commented Mar 20, 2022

Setup info

Hello-IT version: Hello-IT-1.6.0
macOS version: macOS 11.6.5
Preferences deployed via: defaults
Preferences targeting: device

Setup goal

I am trying to troubleshoot some discrepencies between ComputerName and LocalHostName. I just want a basic display of these 2 variables. It's a simple and a local testing of the tool for the moment with the default provided script file in /Library/Applications Support/com.github.ygini.hello-it/CustomScripts/com.github.ygini.hello-it.hostname.sh (the argument %C should print out the ComputerName, the argument %L should print out the LocalHostName).
I created and stored a com.github.ygini.hello-it.plist into /Library/Preferences. See below.

Issue description

As you could see below, you provide on your Wiki 2 examples, however with 2 different syntax for the arguments (see in bold). I did many tests with either the first syntax or the second syntax with no good result. I obviously altered the argument to %C and to %L accordingly for my test. In all cases, it always prints out the ComputerName (%C).

Extract provided on this page: https://github.com/ygini/Hello-IT/wiki/public.script.item and the table at the top clearly mentions the "options" key.

sc1

However, the extract provided on this page: https://github.com/ygini/Hello-IT/wiki/Preferences says something different.

sc2

Now, looking at an extract of the bash script you provide:

sc3

What I put in bold always returns an empty string. Consequently the conditional test after that, sets the format variable to %C. In essence I can never print out anything else but the ComputerName.

You detailed a lot in your documentation, especially for the public.script.item function (https://github.com/ygini/Hello-IT/wiki/public.script.item). However you don’t explain what "$HELLO_IT_PLIST_PATH" is in the "Environmental variables" section of that page.

As you understand, I did a default installation of the Hello-IT tool.

I created and stored a com.github.ygini.hello-it.plist into /Library/Preferences

Here is the content of that file in order to display 2 titles: one for the ComputerName, one for the LocalHostName. I tried many combinations, it only prints out the ComputerName as per explanations given above.

sc4

The script used (com.github.ygini.hello-it.hostname.sh) is one of those provided into /Library/Applications Support/com.github.ygini.hello-it/CustomScripts

I’d be very grateful if you could tell me:

  • the correct syntax to use in the plist file.
  • where to define $HELLO_IT_PLIST_PATH? Should I assume it should be set globally somewhere to point to /Library/Preferences/com.github.ygini.hello-it.plist. If yes, that "defaults read" command in the script file is unable to parse the plist file to fetch the "format" key given the structure of the plist file. Would a /usr/libexec/PlistBuddy command be the solution? If yes, how?

I hope you will be able to help me out.
Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant