|
|
| Author |
Message |
| fuzz |
This post is not being displayed .
|
 fuzz World Chat Champion

Joined: 24 Mar 2004 Karma :   
|
 Posted: 09:24 - 22 Mar 2006 Post subject: Calling Mac OS 1337|\|355 |
 |
|
I need to find someway of shutting down a Mac (OS 10.4) after a certain time period. The way it needs to work, is to have the script check the last modified date of the antivirus folder. If it is less than 23 days, it ignores it and everything carries on as normal. Between 23 days and 29 days, it should display a message saying 'You have x days left' or something. On the 30th day, it should show a message 'Please return the laptop' and shutdown after a short delay. It needs to only work on a limited account, obviously not the root or admin account. My knowledge of UNIX and MacOS is utter shite to say the least, so any help on the matter is greatly appreciated. ____________________ https://www.bikepics.com/members/fuzzbcf/
Bikes: '99 NSR125R, '00 SV650S, K1 GSX-R600, '97 CB500, K3 SV1000S, '16 VFR800 |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Suzuki |
This post is not being displayed .
|
 Suzuki Roger

Joined: 03 May 2005 Karma :  
|
 Posted: 10:29 - 22 Mar 2006 Post subject: |
 |
|
Write a little script that checks the date of the folder, and does nothing if it's OK, or runs your shutdown/message script if it's too old.
Then add that script to cron, and set it to run every hour or something.
Could also add the script to a startup routine, so if it's too old it'll shutdown as soon as they start the laptop too. ____________________ <Simple> no I'm shaven Jon
<Simple> it is a big enough hole.. I'll leave it now
Ride: 1999 Suzuki GSXR600 (yellow/black) IRC: Stats - Relationship Map |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| fuzz |
This post is not being displayed .
|
 fuzz World Chat Champion

Joined: 24 Mar 2004 Karma :   
|
 Posted: 12:13 - 22 Mar 2006 Post subject: |
 |
|
I would write the script, but I can't
But yes, that's the idea. It needs to run once when they log in on the limited account. ____________________ https://www.bikepics.com/members/fuzzbcf/
Bikes: '99 NSR125R, '00 SV650S, K1 GSX-R600, '97 CB500, K3 SV1000S, '16 VFR800 |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Suzuki |
This post is not being displayed .
|
 Suzuki Roger

Joined: 03 May 2005 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| fuzz |
This post is not being displayed .
|
 fuzz World Chat Champion

Joined: 24 Mar 2004 Karma :   
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Suzuki |
This post is not being displayed .
|
 Suzuki Roger

Joined: 03 May 2005 Karma :  
|
 Posted: 09:30 - 26 Mar 2006 Post subject: |
 |
|
You still struggling with this? Or have you sorted it yet? ____________________ <Simple> no I'm shaven Jon
<Simple> it is a big enough hole.. I'll leave it now
Ride: 1999 Suzuki GSXR600 (yellow/black) IRC: Stats - Relationship Map |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| fuzz |
This post is not being displayed .
|
 fuzz World Chat Champion

Joined: 24 Mar 2004 Karma :   
|
 Posted: 20:51 - 26 Mar 2006 Post subject: |
 |
|
I've written an Applescript that checks the date of a file, then warns or shuts down the system depending on the date. The trouble I'm having now is getting the script to run when the limited user logs in. I have set it to run at login, but it requires the user to click the app opening icon on the dock to run the script. If the user doesn't click it, it times out. If I can get it to run the script automatically, all will be well. I tried using osascript, but found out it doesn't like user interaction, i.e. display dialogs. ____________________ https://www.bikepics.com/members/fuzzbcf/
Bikes: '99 NSR125R, '00 SV650S, K1 GSX-R600, '97 CB500, K3 SV1000S, '16 VFR800 |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| fuzz |
This post is not being displayed .
|
 fuzz World Chat Champion

Joined: 24 Mar 2004 Karma :   
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Suzuki |
This post is not being displayed .
|
 Suzuki Roger

Joined: 03 May 2005 Karma :  
|
 Posted: 10:32 - 27 Mar 2006 Post subject: |
 |
|
Ooooh
I've never use Applescript, so I will be completely useless to you now.
Perl I could have handled  ____________________ <Simple> no I'm shaven Jon
<Simple> it is a big enough hole.. I'll leave it now
Ride: 1999 Suzuki GSXR600 (yellow/black) IRC: Stats - Relationship Map |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| fuzz |
This post is not being displayed .
|
 fuzz World Chat Champion

Joined: 24 Mar 2004 Karma :   
|
 Posted: 11:06 - 27 Mar 2006 Post subject: |
 |
|
I think Applescript was the wrong way to go. It does the job, but I cant run it from the limited account, even if I give it rwx permissions. ____________________ https://www.bikepics.com/members/fuzzbcf/
Bikes: '99 NSR125R, '00 SV650S, K1 GSX-R600, '97 CB500, K3 SV1000S, '16 VFR800 |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Suzuki |
This post is not being displayed .
|
 Suzuki Roger

Joined: 03 May 2005 Karma :  
|
 Posted: 11:19 - 27 Mar 2006 Post subject: |
 |
|
You'd probably be best writing a shell script.
If you're struggling with what the commands are, drop me a PM or MSN me.  ____________________ <Simple> no I'm shaven Jon
<Simple> it is a big enough hole.. I'll leave it now
Ride: 1999 Suzuki GSXR600 (yellow/black) IRC: Stats - Relationship Map |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| fuzz |
This post is not being displayed .
|
 fuzz World Chat Champion

Joined: 24 Mar 2004 Karma :   
|
 Posted: 08:40 - 29 Mar 2006 Post subject: |
 |
|
Sorted it I kept the Applescript but changed it around a little to get it to work with a login hook. ____________________ https://www.bikepics.com/members/fuzzbcf/
Bikes: '99 NSR125R, '00 SV650S, K1 GSX-R600, '97 CB500, K3 SV1000S, '16 VFR800 |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| ali-b |
This post is not being displayed .
|
 ali-b Trackday Trickster

Joined: 19 May 2005 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
Old Thread Alert!
The last post was made 19 years, 320 days ago. Instead of replying here, would creating a new thread be more useful? |
 |
|
|