speedkills Posted January 27, 2011 Posted January 27, 2011 That's great news, heading to bed now but I'll give it a shot tomorrow after work. I appreciate your effort on this, as does my girlfriend who has already commented on the system "setting down the past few days"
ideal Posted February 5, 2011 Posted February 5, 2011 My setup is a Mac Mini running a Windows Home Server (WHS) virtual machine. Plex on the Mini plays media content stored on the WHS. If Plex 9 had the ability to mount SMB shares, my life would be simple. However, it doesn't, and the developers suggest adding the mounts to the Mac user login items. This is a non-starter in my case because the WHS virtual machine isn't even running when the user logs in so none of the shares are up. This script is exactly what I needed to watch for the WHS to come up, and then mount the shares. I have one small suggestion. The standard location for scripts like this in UNIX-like systems is /usr/local/bin. See: http://en.wikipedia.org/wiki/Unix_directory_structure
smoldersonline Posted February 5, 2011 Posted February 5, 2011 This worked like a charm with smb shares (thanks again!). Unfortunately, I cannot get it to work with afp, maybe I'm missing something? Error as follows:[removed] Edit: Very sorry , also works with afp (forgot to change username)
speeding_ant Posted February 5, 2011 Author Posted February 5, 2011 My setup is a Mac Mini running a Windows Home Server (WHS) virtual machine. Plex on the Mini plays media content stored on the WHS. If Plex 9 had the ability to mount SMB shares, my life would be simple. However, it doesn't, and the developers suggest adding the mounts to the Mac user login items. This is a non-starter in my case because the WHS virtual machine isn't even running when the user logs in so none of the shares are up. This script is exactly what I needed to watch for the WHS to come up, and then mount the shares. I have one small suggestion. The standard location for scripts like this in UNIX-like systems is /usr/local/bin. See: http://en.wikipedia.org/wiki/Unix_directory_structure Cheers for the feedback! Issue is that OS X hides all unix folders, so for the newbies sake it is located /Scripts. You can change the directory to your preferred folder in the settings. Still having issues with how OS X sometimes doesn't unmount shares if the server is turned off. There's no easy way yet to force them to unmount without checking folder contents. If I integrated that into the script then the drives would never spin down. UnRAID doesn't turn off any ports as far as I can see, so I stopped at that point. Unless there's a wget / curl command, E.g http://tower/main?=stopped responds true or false? Otherwise, it works well with AFP, which actually tells the computer that unRAID has stopped so it can unmount. SMB isn't as smart
EdgarWallace Posted February 9, 2011 Posted February 9, 2011 Speeding_ant & Stokkes thank you very much for this. I love that script !! I'm using it with the latest AFP support of unRAID 5b4. The one question I have is the following: Is it possible to define a second protocol? Namely NFS would be great as I symlinked the ~/Library/Application Support/XBMC/userdata directory to the unRAID server which is needed to synchronize all the XBMC consoles at my home. I don´t know if another option would be to establish a symlink via AFP ??
speeding_ant Posted February 9, 2011 Author Posted February 9, 2011 I could potentially integrate a secondary protocol, but you're probably better off using a symlink through an AFP share. That's how I sort out my iTunes folder. NFS can be a pain to deal with, better off using a protocol that Apple can support really well. You could also look into managed preferences to create a folder redirection on login. However, that does require the server to be available at all times. Cheers
darbronnoco Posted March 27, 2011 Posted March 27, 2011 So I set this up and added the shares like # Shares, check notes SHARES="Our%20Movies Our%20Music Our%20Files cache" I mounts tower, but I do not she the shares listed in the side bar. I can see all the shares, not just the ones I set in the script in the tower folder. Does this script mount the individual shares under the shared section on the side bar? Or am I missing something? Even just mounting tower works great. Thanks.
speeding_ant Posted March 27, 2011 Author Posted March 27, 2011 Are the volumes showing up on the desktop? Make sure you have this setting turned on in the finder preferences first. Double check the instructions, and make sure that the launchd preference file is being run from your user folder. If you're running the script from terminal, make sure you're not running it as root. It should show up on the sidebar, but sometimes it can take finder a while to discover the server and show it. The volumes should still mount, and will eventually show as mounted in the sidebar. If you're using UnRAID 5.0 beta 5b then switch to AFP. Cheers
peter_sm Posted March 27, 2011 Posted March 27, 2011 I got this error com.mount.media[188] mount_smbfs: mount error: /Volumes/tvixhd1: No such file or directory So it's looks like the script is not looking to my mac drive, so perhaps this must be entered in the script , so it's look to my mac partition tvixhd1 is my share
darbronnoco Posted March 27, 2011 Posted March 27, 2011 Ok when I check show connected servers in the finder preferences it does show the shares I selected. I guess I has hoping they would show up in the side bar. I don't really like things on my desktop. Tower does show up in the side bar right away which is great too. So even if I don't have the shares listed there, it's still a nice feature. Otherwise like you say you might have to wait a while until tower shows up. I don't have the 5.0 Beta yet, I don't want to test it on my primary server. Thanks again for the help at least I know the script is working as designed.
darbronnoco Posted March 27, 2011 Posted March 27, 2011 I have the itunes check set to false since I don't have itunes on my unraid box. But when I have it set to false Itunes will quit after a minute. When I set the check to true everything worked again. I was wondering if it is possible to modify the script so there could be an itune integration True false variable and if the user sets false have it skip the entire section for checking itunes and if true it goes about checking if the drives are mounted then opening or closing itunes. Maybe it is already this way, but I seem to be having a problem with it when itunes is set to false.
speeding_ant Posted March 27, 2011 Author Posted March 27, 2011 I got this error com.mount.media[188] mount_smbfs: mount error: /Volumes/tvixhd1: No such file or directory So it's looks like the script is not looking to my mac drive, so perhaps this must be entered in the script , so it's look to my mac partition tvixhd1 is my share That error means it's trying to mount the smb share into that particular folder in the Volumes directory, but it's not there. The script attempts to create a folder in the /Volumes directory. You'll need to double check and make sure that there's no permissions issue stopping the script from creating that directory.
speeding_ant Posted March 27, 2011 Author Posted March 27, 2011 I have the itunes check set to false since I don't have itunes on my unraid box. But when I have it set to false Itunes will quit after a minute. When I set the check to true everything worked again. I was wondering if it is possible to modify the script so there could be an itune integration True false variable and if the user sets false have it skip the entire section for checking itunes and if true it goes about checking if the drives are mounted then opening or closing itunes. Maybe it is already this way, but I seem to be having a problem with it when itunes is set to false. Modified script, there is an additional option where you can set iTunes to not quit if server isn't available. It is under the iTUNES open option. Cheers
darbronnoco Posted March 27, 2011 Posted March 27, 2011 Awesome, thanks for the quick response! I'll test it out.
speeding_ant Posted March 27, 2011 Author Posted March 27, 2011 Actually can you download again. Found a logic issue, iTunes wouldn't quit if you can ping the server. Now it works as expected in all situations.
darbronnoco Posted March 27, 2011 Posted March 27, 2011 Now it stopped working all together... nothing mounts. WHen I manually run the script it says that is is already mounted. I don't see any of the drives on the desktop or tower in the shared side bar. Is there any way to make the shares show up on the side bar?
speeding_ant Posted March 27, 2011 Author Posted March 27, 2011 Restart the computer and try again. Don't have server on to check, but haven't changed anything to do with mounting at all? If it's saying that it's mounted already, the folders might still be there in /Volumes. Might be worth checking if they're still there on restart, and if they are then move them to the trash.
darbronnoco Posted March 27, 2011 Posted March 27, 2011 ok I fat fingered my ip address. Threw me off because the first time I manually ran it the message said it was already connected. Seems to be working now.
darbronnoco Posted March 27, 2011 Posted March 27, 2011 Thanks, this will be great for Plex. It gets cranky when my shares are not mounted. Great work. I can't wait until 5.0 is ready for general release. AFP baby!
speeding_ant Posted March 27, 2011 Author Posted March 27, 2011 I'm using 5 beta 5 without issue at the moment, that's the one just before the slots issue. Seems pretty solid.. Few minor bugs, but all major work like adding disks etc works fine. AFP rocks
darbronnoco Posted March 28, 2011 Posted March 28, 2011 Ok so if folks want it on the side bar just drage the drives that mounted on the desktop to the devices section. Then go back to the finder prefs and turn off connected servers. Bingo. It stuck for me after a reboot.
speeding_ant Posted April 4, 2011 Author Posted April 4, 2011 Added functionality to wake the server via WOL. You must have wolcmd (included) in the same folder as the script. This is a definable directory. If the server is unavailable via ping, WAKE is set to TRUE, and the time is within the hours specified, then the script will attempt wake on lan. You must have your server MAC address and subnet in the options. This is all shown in the script. Download again to gain this functionality. wolcmd included.
defected07 Posted May 20, 2011 Posted May 20, 2011 This was working ok, until a few days ago. Here's my Console output: May 19 22:12:14 defected07 com.mount.media[50266]: ping: sendto: Host is down May 19 22:12:25 defected07 com.mount.media[50266]: PING 192.168.1.73 (192.168.1.73): 56 data bytes May 19 22:12:25 defected07 com.mount.media[50266]: --- 192.168.1.73 ping statistics --- May 19 22:12:25 defected07 com.mount.media[50266]: 1 packets transmitted, 0 packets received, 100.0% packet loss May 19 22:12:25 defected07 com.mount.media[50266]: Waking Server May 19 22:12:25 defected07 com.mount.media[50266]: Failed to send: Host is down May 19 22:12:25 defected07 com.mount.media[50266]: Wake on Lan signal sent to MAC Address 001b21a48247 May 19 22:12:25 defected07 com.mount.media[50266]: via Broadcast Address 192.168.1.255 on port 7 May 19 22:12:25 defected07 com.mount.media[50266]: We should send 102 bytes we sent -1 bytes When I manually run it through Terminal, I get this: ./mount.sh PING 192.168.1.73 (192.168.1.73): 56 data bytes --- 192.168.1.73 ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.258/0.258/0.258/0.000 ms Mounting Backup Usage: file [-bcikLhnNrsvz0] [-e test] [-f namefile] [-F separator] [-m magicfiles] file... file -C -m magicfiles Try `file --help' for more information. Mounting Media Usage: file [-bcikLhnNrsvz0] [-e test] [-f namefile] [-F separator] [-m magicfiles] file... file -C -m magicfiles Try `file --help' for more information.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.