image
image

Go Back   macosx.com > Mac Help Forums > Mac OS X System & Mac Software

Reply
 
LinkBack Thread Tools
  #1  
Old July 7th, 2009, 07:48 AM
Registered User
 
Join Date: Jul 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|G2| is on a distinguished road
Applescript: mount SMB shares / WakeOnLAN

i have searched the forums for this, and checked the Scripts repositories, so hopefully my first thread (and post!) isn't going to upset anyone.

my Mac Mini runs the following Applescript at boot in order to mount SMB shares from my NAS:
Code:
delay 5
mount volume "smb://192.168.1.101/Folder1"
mount volume "smb://192.168.1.101/Folder2"
mount volume "smb://192.168.1.101/Folder3"
however, the NAS isn't left on all the time and as it supports WakeOnLAN i'd like to enhance the script to do the following:

ping 192.168.1.101
--response: run 'mount' code and exit
--no response:
----create and send magic packet for WOL
----wait a set amount of time
----ping again:
------response = run 'mount' code and exit
------no response = wait and try again 2/3 times before failing with useful message

anyone know how to do this? or even if the WOL bit is possible in Applescript? or could it be done with other scripting, or perhaps with a call out to a command-line program like XWOL? if so, any advice there would also be welcomed.

and i'd like the script to run Plex once it has successfully mounted the shares. am i right in thinking the following would work?
Code:
tell application "Plex" activate
thanks in advance for any help.

Last edited by |G2|; July 7th, 2009 at 07:50 AM. Reason: Typos
Reply With Quote
Reply

Bookmarks

Tags
applescript, os x, smb, wakeonlan, wol

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump


All times are GMT -5. The time now is 08:01 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
Copyright 2000-2010 DigitalCrowd, Inc.