Anyone know what : "Rep argument is not a dictionary" means??

kerouak
Valued Contributor

I'm running the following script which Writes to loginwindow and sets the text

I get the above error mesage

Sorry for the 1st post, it wasn't quite right... any ideas very welcome

Here's the UPDATED script:

>>

!/bin/sh

API details with computer read privs

apiUser="xxx"
apiPass="xxx"
jssURL="https://xxxxxx:8443"

Get the computer's name

compName=$(scutil --get ComputerName)

Possible strings to use below:

"username"

"real_name"

"email_address"

"position"

"phone"

"department"

"building"

"room"

section="department"

LocationData=$(curl -H "Accept: text/xml" -sfku "${apiUser}:${apiPass}" "${jssURL}/JSSResource/computers/macaddress/$(networksetup -getmacaddress en0 | awk '{print $3}')/subset/location" | xmllint --format - 2>/dev/null | grep "<${section}" | awk -F'>|<' '{print $3}')

sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "$LocationData"

<<

1 REPLY 1

justin_smith
New Contributor III

"$dept" doesn't appear to be set. This is passing an empty variable to defaults.