Yep it's time for my daily question.
This one should be easy!!
We rename all our startup disks X. So I've written a little script to do this.
sudo -u $AdminUser -p $AdminPassword diskutil rename $CurrentVolumeName $NewVolumeName
The above variables are all passed to $4-8 in Casper fine.
I can use the above to change X to Data or any other one word name.
Trouble is I want to rename 'Macintosh HD.' via ard or locally I'd write 'Macintosh HD' as 'Macintosh HD"
However Casper seems to pass te variable with the so the mac see's it as an illegal character.
Missing out the leads to the mac think ing I'm passing 3 variables & that too fails.
What's the simple thing I'm missing this time??
Grey Communications Group Limited
Registered No. 1795794, Registered in England
Registered Office The Johnson Building, 77 Hatton Garden, London, EC1N 8JS
VAT Number GB 404 6245 78
You would add the quotes or escapes when putting this into a script, but
On 3/17/10 5:20 PM, "Ben.Toms at grey.com" <Ben.Toms at grey.com> wrote:
you're entering this into one of Casper Remote's (I assume) script parameter
While I haven't tested this, have you just tried:
with no quotes and no escapes?
Merrill Communications LLC
I wonder if you can declare an internal field separator, ie IFS in the script to tell it how to treat white space. It seems it wants to treat spaces with commas, to delimit the values. I am guessing it was done this way for injection into the database????? Therefore, it delimits each filed by a comma?
I had a similar issue recently and what I ended up putting in my script to
make it work was double quotes so it looked like below.
This way you can put in the volume name with out the and it will quote it
Hope this helps.
The Integer Group
So JAMF clearly passes the parameter through just fine??
Something else is borked cause I ran this with Excel open :(
#!/bin/bash process="$4" url="$5" echo $process "is what JAMF sees" if pgrep -xq $process then echo $process "is running. Exiting" else ## DOWNLOAD UPDATE PKG ## echo "Downloading Office 365 media from https://www.microsoft.com" # mkdir /tmp/O365 # cd /tmp/O365 ## DOWNLOADING PKG## # curl -O -J -L $url ## CAPTURING O365 PKG NAME AS VARIABLE ## # package=`ls /tmp/O365` # echo "Installing $package..." # sudo installer -pkg "/tmp/O365/$package" -target / # echo "Install Complete" ## CLEANUP ## # echo "Cleaning Up Before Exiting" # rm -rf /tmp/O365/ # echo "Cleanup Complete, Now Exiting." # echo "$4 Updated Successfully" fi exit 0
In the log of the policy when ran: