Posted on 11-09-2012 05:43 AM
Hello.
We currently do not require login credentials to self service. I believe this is causing the third variable to be empty when scripts are run through self service. Can anyone confirm that (I'm running 8.61). I have a simple script to echo back the $1, $2, $3 and the $3 comes back empty.
The KB article (https://jamfnation.jamfsoftware.com/article.html?id=146) says the the third variable will be filled with the user logged into self service. Does that mean that if you don't require logging in to self service you can't use $3?
Thanks.
Chris
PS -> The point of the original script was to remove the cached MCX files from the computer and local user, via dscl . -mcxdelete /Users/$3.
Solved! Go to Solution.
Posted on 11-09-2012 06:17 AM
that is correct. As you are logging in as anonymous $3 returns empty.
If you would like to capture the logged in user to the computer (who is running the Self Service anonymously from his/her computer account) then use the command below.
user=ls -l /dev/console | cut -d " " -f 4
Posted on 11-09-2012 06:17 AM
that is correct. As you are logging in as anonymous $3 returns empty.
If you would like to capture the logged in user to the computer (who is running the Self Service anonymously from his/her computer account) then use the command below.
user=ls -l /dev/console | cut -d " " -f 4
Posted on 11-09-2012 06:20 AM
Gracias Cem!
I just wanted to make sure I was understanding the KB correctly! I am planning on moving it to a weekly/monthly login script anyway, to make sure the user gets the proper settings at least once a week/month.
Posted on 11-09-2012 06:22 AM
or you can use MCX
Posted on 11-09-2012 08:00 AM
Currently we use the MCX, but for some reason there are some machines that won't allow the MCX's to be updated. For example there was a machine that would not look at the proper SUS, delete the MCX, having casper push a new MCX, all of it didn't work. It wasn't until I erased the MCX's via the dscl command and then re-applied with jamf did the MCX's work.