[Casper] Bash Scripts using ~

Dorey, Dustin Dustin.Dorey at district196.org
Tue Apr 21 10:14:15 PDT 2009


Try 

 

 

#!/bin/sh

cd /Users/$3/Desktop/

mkdir testfolder

 

I was just doing a similar test where I created a shell script threw it in casperadmin then executed it as a policy of once per user triggered by login.   My test one was

 

#!/bin/sh

cd /Users/$3/Desktop/

rm Test.rtf

 

 

and that seemed to work fine.   Ultimately I have some files that I need to change permissions to that are residing in our bound users library, but for testing purposes just to get used to the concept that’s what I did.  The other guys on here have done WAY more with this than I have.

 

-Dusty-

 

 

Dustin  Dorey

Technology Support Cluster Specialist

Independant School District 196

Rosemount-Apple Valley-Eagan Public Schools

dustin.dorey at district196.org

651|423|7971

 

 

From: casper-bounces at list.jamfsoftware.com [mailto:casper-bounces at list.jamfsoftware.com] On Behalf Of dhowell at austinisd.org
Sent: Tuesday, April 21, 2009 12:04 PM
Cc: casper at list.jamfsoftware.com
Subject: Re: [Casper] Bash Scripts using ~

 


SO just even trying a simple script like this it doesn't work 

#!/bin/bash 


mkdir  ~/Desktop/testfolder 




SO I tried what Ryan said and used $3 variable 

mkdir /Users/$3/Desktop/testfolder 

still couldn't get it to work??????? 

I am putting it in Self Service so I can test it. What I am doing is trying to kill logged in users MCX settings and refresh. the script works if ran by terminal. 



D. Trey Howell
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&#8217, 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.




"Dorey, Dustin" <Dustin.Dorey at district196.org> 
  

04/21/2009 10:50 AM 

To

<dhowell at austinisd.org>, <casper at list.jamfsoftware.com> 

cc

	
Subject

RE: [Casper] Bash Scripts using ~

 

		




Can you give examples of what you’re trying to do? 
  
Are you running them from policy?   They are then executing as root not the current user I believe. 
  
I’m working on some of the same stuff as well currently. 
  
-Dusty- 
  
  
Dustin  Dorey 
Technology Support Cluster Specialist 
Independant School District 196 
Rosemount-Apple Valley-Eagan Public Schools 
dustin.dorey at district196.org 
651|423|7971 
  
  
  
From: casper-bounces at list.jamfsoftware.com [mailto:casper-bounces at list.jamfsoftware.com] On Behalf Of dhowell at austinisd.org
Sent: Tuesday, April 21, 2009 10:46 AM
To: casper at list.jamfsoftware.com
Subject: [Casper] Bash Scripts using ~ 
  

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
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&#8217, 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. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.jamfsoftware.com/pipermail/casper/attachments/20090421/63b25c2f/attachment.htm 


More information about the Casper mailing list