 |
 |
How do I issue Shutdown-h now command to other machine on network
|
 |
|
 |
|
Senior User
Join Date: Sep 2000
Location: Noo Yawk
Status:
Offline
|
|
Hi lazy admin question
How using Terminal would I issue "Shutdown-h now" command to other machine on network.
I guess what I'm tring to do is take control of Terminal.app on the iMac (10.0.1.x) via airport, so that I can shut down the other machine without physically having to go over there. ?
I have admin on both machines.
Thanks very much!
Airport 'network'
TiBook OSX 10.2.5 (admin)
iMac 10.1.4
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Can't you do it through ssh?
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Sep 2000
Location: Noo Yawk
Status:
Offline
|
|
Originally posted by Chuckit:
Can't you do it through ssh?
I was hoping there might be an easier way? -- SSH seemed complicated at first glance -- but having tried it I discovered it's not so bad after all!! Easier than I thought! Fun even.
However, somewhere there's not an association between the IP address of the other machine and its network name, so I have to look up 10.0.1.IP? as it keeps on changing.
But don't let that stop anyone posting any other solutions...
Thanks
(Last edited by vsurfer; May 10, 2003 at 06:54 PM.
)
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Sep 2000
Location: Noo Yawk
Status:
Offline
|
|
Originally posted by vsurfer:
I was hoping there might be an easier way? -- SSH seemed complicated at first glance -- but having tried it I discovered it's not so bad after all!! Easier than I thought! Fun even.
However, somewhere there's not an association between the IP address of the other machine and its network name, so I have to look up 10.0.1.IP? as it keeps on changing.
But don't let that stop anyone posting any other solutions...
Thanks
Hmm wonder if I can play or start up iTunes playlists on that iMac remotely -- possible?
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status:
Offline
|
|
Originally posted by vsurfer:
Hmm wonder if I can play or start up iTunes playlists on that iMac remotely -- possible?
There's about a gazillion iTunes-control scripts (generally AppleScript-based) that use Remote Apple Events to control iTunes on a remote machine.
Remote Events have been a feature of the Mac OS for years and years. It's a too-often overlooked feature of the Mac and AppleScript, but it's as easy as:
Code:
set remoteMac to "eppc://192.168.1.1/" -- IP address of remote machine
tell application "iTunes" of machine remoteMac
activate -- start up
play -- start playing
end tell
Of course you could substitute the relevant track/playlist/whatever that you wanted to play, but you get the idea.
As for the remote machine shutdown:
shell:
ssh ip.remote.machine shutdown -h now
AppleScript:
Code:
set remoteMac to "eppc://192.168.1.1/"
tell application "System Events of machine remoteMac -- assuming Mac OS X, use Finder for earlier OS versions
shut down
end tell
|
|
Gods don't kill people - people with Gods kill people.
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Sep 2000
Location: Noo Yawk
Status:
Offline
|
|
Thanks Camelot and Chuckit
The ssh worked great, and was easier than I thought. Got that semi-scripted apart from the password. (Maybe look into DSA keys?)
The apple events -- overlooked like many other mac features -- and something to look into.
Thanks very much for the tips.
PS. what kind of protocol is "eppc" ?
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status:
Offline
|
|
Originally posted by vsurfer:
Thanks Camelot and Chuckit
The ssh worked great, and was easier than I thought. Got that semi-scripted apart from the password. (Maybe look into DSA keys?)
The apple events -- overlooked like many other mac features -- and something to look into.
Thanks very much for the tips.
PS. what kind of protocol is "eppc" ?
Using keys would certainly save you having to enter a password each time you ssh'd to the remote machine. There's plenty of online tutorials that walk through the steps.
As for eppc://, I forget what the 'e' stands for, but the ppc part is 'process to process communication', a foundation of AppleEvents.
|
|
Gods don't kill people - people with Gods kill people.
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Nov 2002
Location: mentalspace
Status:
Offline
|
|
Originally posted by Camelot:
Using keys would certainly save you having to enter a password each time you ssh'd to the remote machine. There's plenty of online tutorials that walk through the steps.
As for eppc://, I forget what the 'e' stands for, but the ppc part is 'process to process communication', a foundation of AppleEvents.
Thanks Camelot.
Good stuff this.
Now were cooking with gas. OK well maybe with simple applescripts on the other machine across the network, but a start.
----------
I did try other method and got following response
[localhost:~] borg% set remoteMac to "eppc://10.0.1.2"
set: Variable name must begin with a letter.
Not sure why
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|