Link to home
Start Free TrialLog in
Avatar of Elthamtech
Elthamtech

asked on

Lock/logoff/disable Apple Mac if network cable unplugged

Can anyone think of a way to lock/logoff/disable an iMac when the network cable is unplugged or it loses network connectivity?

Our students unplug the network cable in an effort to stop remote control and avoid managed preferences.

Running OSX Snow Leopard

Any help/ideas appreciated!

Avatar of sweetfa2
sweetfa2
Flag of Australia image

http://tech.inhelsinki.nl/locationchanger/

The above link shows you how to launch a process when network status changes.  You can then launch a script to do what you want using launchctl when the network status goes to down - and likewise restore everything when they plug it in again.
Avatar of Elthamtech
Elthamtech

ASKER

I am fairly new to the Mac world...Do you think you could please explain to me how that works?
ASKER CERTIFIED SOLUTION
Avatar of sweetfa2
sweetfa2
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The second script says there's a syntax error somewhere on this line:

if [[ -z $1 ]]; then

Expected “,” or “]” but found unknown token.
if [[ -z "$1" ]]; then
All good - cheers I sorted that out. Took a while to get back to it,  but when I did your posts helped!