[Casper] Bash Scripts using ~
Ernst, Craig S.
ERNSTCS at uwec.edu
Wed Apr 22 06:23:39 PDT 2009
A few ways to get to the end results it seems. I've been using the following to get me a variable for $username
username=`/usr/bin/w | grep console | awk '{print $1}'`
On 4/21/09 3:38 PM, "Thomas Larkin" <tlarki at kckps.org> wrote:
Another idea would be this, make sure you test it out
current_user=`/usr/bin/finger -s -l | grep Login`
mkdir /Users/$current_user/testdir
When I su to root in the shell and run finger it still picks up my
account as being logged in.
___________________________
Thomas Larkin
TIS Department
KCKPS USD500
tlarki at kckps.org
blackberry: 913-449-7589
office: 913-627-0351
>>> Steve Wood <swood at integerdallas.com> 04/21/09 2:32 PM >>>
I just tested using Ryan's script, and sure enough, the $3 variable
does not
work with logged in users (using Remote or Self Service). It appears
that
variable only fills during login (or logout...I didn't test logout).
Steve Wood
Director of IT
swood at integerdallas.com
The Integer Group | 1999 Bryan St. | Ste. 1700 | Dallas, TX 75201
T 214.758.6813 | F 214.758.6901 | C 940.312.2475
On Tue, Apr 21, 2009 at 2:00 PM, Ryan Harter <rharter at uwsp.edu> wrote:
> I thought they worked with self service too. You could test this out
with
> the following script.
> #!/bin/bash
>
> echo "$1" >> /tmp/variables.txt
> echo "$2" >> /tmp/variables.txt
> echo "$3" >> /tmp/variables.txt
>
> Then you should be able to run it and see what the variables are.
Make
> sure you run it with casper to test it.
> *
> Ryan Harter*
> UW - Stevens Point
> Workstation Developer
> 715.346.2716
> Ryan.Harter at uwsp.edu
>
> On Apr 21, 2009, at 1:42 PM, Ernst, Craig S. wrote:
>
> Forgive me if I am spreading bad information, but I was under the
> impression that scripts that called the logged on user only worked
with
> login and logout policies and not anything else. Can someone tell me
if that
> statement is wrong?
>
> Craig E
>
> On 4/21/09 1:37 PM, "dhowell at austinisd.org" <dhowell at austinisd.org>
wrote:
>
>
> Craig,
>
> I am just trying to get them to work in Self Service now, or even
push them
> out through Remote.
>
> When I hard code it , it works. I just can't get it to reconize any
> variables
>
> I have used $1, $3, $home, ~
>
> still no luck
>
> D. Trey Howell
> trey.howell at austinisd.org
> Desktop Engineering
> 414-0102
>
> Secret Windows code: while (1) { if (num_process > 1) {
bluescreen(rand());
> } }
>
> This email message, including all attachments, is for the sole use of
the
> intended recipient(s) and may contain confidential student and/or
employee
> information. Unauthorized use of disclosure is prohibited under the
federal
> Family Education Rights & Privacy Act (20 U.S.C. §1232g, 34 CFR Part
99, 19
> TAC 247.2, Gov’, t Code 552.023, Educ. Code 21.355, 29 CFR
> 1630.14(b)(c)). If you are not the intended recipient, you may not
use,
> disclose, copy or disseminate this information. Please call the
sender
> immediately or reply by email and destroy all copies of the original
> message, including attachments.
>
>
>
> *"Ernst, Craig S." <ERNSTCS at uwec.edu>*
> 04/21/2009 01:22 PM
>
> To
>
> "dhowell at austinisd.org" <dhowell at austinisd.org>, Casper List <
> casper at list.jamfsoftware.com>
>
> cc
> Subject
>
> Re: [Casper] Bash Scripts using ~
>
>
>
>
> If you go into your JSS under the Management Tab -> Management
Preferences,
> what do you have checked for options under the Create Login/Logout
Hooks
> section?
>
> Are you seeing the policies triggered and attempting to run the
script
> under /var/jamf.log?
>
> Craig E
>
>
> On 4/21/09 10:46 AM, "*dhowell at austinisd.org* <dhowell at austinisd.org>
" <*
> dhowell at austinisd.org* <dhowell at austinisd.org> > wrote:
>
>
> I can't get any of my login hooks to work in Casper self service. I
do have
> other scripts that work
>
> It seems anytime I use the ~ for logged in user it doesn't work.
>
>
> Is this treated differently in Casper. I run it in terminal it works
fine.
> I am sure It is me doing something wrong
>
>
> D. Trey Howell
> *trey.howell at austinisd.org* <trey.howell at austinisd.org>
> Desktop Engineering
>
> Secret Windows code: while (1) { if (num_process > 1) {
bluescreen(rand());
> } }
>
> This email message, including all attachments, is for the sole use of
the
> intended recipient(s) and may contain confidential student and/or
employee
> information. Unauthorized use of disclosure is prohibited under the
federal
> Family Education Rights & Privacy Act (20 U.S.C. §1232g, 34 CFR Part
99, 19
> TAC 247.2, Gov’, t Code 552.023, Educ. Code 21.355, 29 CFR
> 1630.14(b)(c)). If you are not the intended recipient, you may not
use,
> disclose, copy or disseminate this information. Please call the
sender
> immediately or reply by email and destroy all copies of the original
> message, including attachments.
>
>
> <ATT00001.txt>
>
>
>
> _______________________________________________
> Casper mailing list
> Casper at list.jamfsoftware.com
> http://list.jamfsoftware.com/mailman/listinfo/casper
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.jamfsoftware.com/pipermail/casper/attachments/20090422/b39a16b7/attachment.htm
More information about the Casper
mailing list