Jump to content

speeding_ant

Members
  • Posts

    1,624
  • Joined

  • Last visited

Everything posted by speeding_ant

  1. Just a suggestion, wondered if that would suit your needs is all.
  2. It could be integrated to do all sorts of things. If you wanted it to mount or unmount depending on location change, check this page: http://tech.inhelsinki.nl/locationchanger/ You can modify the launch agent for changes to the system config (changes when you move between networks), and get it to run the script then.
  3. Hopefully AFP will make things a little nicer to deal with. 10.6 doesn't deal with SMB shares well. Apple really needs to keep up with the updates...
  4. Script now quits iTunes if the server and mounts are unavailable. I found iTunes to be unstable if it can't resolve links to its music.
  5. Here here! What a fantastic community this is.
  6. Hey guys, Just realised I've been running the motherboard controller in IDE mode, not AHCI. I'm running 5.0 beta 2, is it possible to switch to AHCI without causing any issues? I'd rather check here first, than cause myself un-neccessary headaches Cheers
  7. Replicated issue. Re-uploaded script with new function. As unRAID doesn't turn off CIFS you can still access that port, which means I have to do checks at the time it mounts. So it creates a folder for the mountpoint, then tries to mount. If it can't mount the share then it will give you an error message. It will then check if the mount point has files in it. If it doesn't then it will remove that directory. If it does, then it will spit an error and move onto the next share. Before you run it, make sure those folders aren't in your /Volumes folder, and try again. From now you shouldn't get that issue again. I didn't want to do the check at the beginning of the script, as it would keep the drives spinning at all times as it continually does checks on the shares. The way I've done it means that it only does the check if there's an error mounting the SMB share. Cheers
  8. Strange, that doesn't happen with me. Are you sure you're using launchd from your user folder? Eg, /users/admin/library/LaunchAgents/com.media.mount.plist ? Might want to repair permissions as well. I could add in a check so when the array is offline it'll check if there are the folders still in /Volumes. If there are it will attempt to umount, then check if there's anything in the folders. If there isn't then it'll delete them.
  9. I've edited the first post with a tutorial. Hope this is thorough enough.
  10. Ah yep, I see your problem. a) Make sure you're editing it in plain text: http://www.macupdate.com/app/mac/8724/plain-text-editor b) The options all have to be surrounded by " ". eg; "HD%20Movies TV Movies"
  11. Which script are you using? Can you attach your modified script (sans username/password of course) so I can check it out? I've got a few shares with spaces, works sweet with me. Cheers
  12. I rewrote my script with some of Stokkes code, added in option for AFP mounts, and now spaces should work. Read notes in file first. File re-uploaded in first post.
  13. Try TV%20Shows If you're running your own DNS server, it should work with hostname. If not, then stick with the IP.
  14. No worries! Stokkes did a better job though... Did you manage to get Stokkes script to work? I tried again, but have issues running it on 10.6.6 client and server. Very strange
  15. Root is same "/Volumes" and shares I've just been testing with "Music Downloads" I'm actually getting parse errors on the comments. Something is up with the way my machine handles bash scripts... What version of OS X are you using? Cheers
  16. Only been in the scene for a couple of years now. Continual effort to keep learning, it's hard work! Have you tested the script yet? Just checked it out, something fishy with the loop for shares. It's creating folders called "echo" "if" etc, under /.
  17. Learning something every day! How long have you been in the business?
  18. Nice one - bit more polished now Move iTunes below the shares, otherwise will just spit errors when shares aren't mounted.
  19. I'm not having those issues. You need to run them from your user folder launch agents. If you run from the main Library Folder, it will run as root. There's no way around this as far as I could see.
  20. Exactly the reason why I made this script Also doesn't try and open the Volume in a window, like if you add the mounts to your login items. They just mount quietly in the background, and only if they're not mounted already and the server is on. Very useful if you run plex, or if you have iTunes running all the time, and your library is sitting on the shares. It runs every minute, so you're seldom left without your volumes mounted. Also, remember to put in the LaunchAgents folder in your user folder. If you use the main Library folder, it won't work.
  21. Cheers! I've found a solution for quitting applications by their real names via terminal (not process ID, which tends to change often), and it will prompt to save documents first, or exit quietly. Unfortunately doesn't work with iTunes, as iTunesHelper daemon conflicts with the name. If you need this, let me know. You can also decide to umount Volumes if there server isn't available, where the else statement is. In the else statement (at the bottom) remove exit 0 and add umount /Volumes/Music etc.
  22. **** UPDATE **** macOS 10.12 Sierra breaks this script. I've developed an application to get around this issue. Available here: AutoMounter: https://itunes.apple.com/nz/app/automounter/id1160435653?mt=12 AutoMounter is a sleek and powerful menu item designed to automatically mount your network shares. - Supports SMB / AFP / NFS network shares - Supports multiple NAS appliances / servers - Server discovery - Persistent auto mounting of shares, when the server is reachable - Match a server to a WiFi Name (SSID) - Reacts to changes of network - Optionally send a Wake On LAN packet to a server when the network changes - Easy to use, unobtrusive, menu bar item - Optionally hide shares from Desktop - Resolves macOS Sierra authentication issue Thought I'd share my quick and simple bash script (with the help from Stokkes) for mounting AFP/SMB shares. Set your preferences, add the shares, and it will ping the server. If it is available then it will mount the shares. There is also an option to load iTunes at the same time. Now works with Lion. **NEW** Added functionality to wake the server via WOL **NEW** 28/12/2012 - Added the ability to call "wake" at the end of the script to wake the server, no matter which time it is. eg: /scripts/mount.sh wake 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. Now if the server is unavailable it will exit iTunes. I found iTunes to be unstable if it can't resolve links to its music. You can set this in the script Step 1: Where to put mount.sh & com.media.mount.plist - Create a folder called "Scripts" on the root of your hard drive. This could be /Macintosh HD/Scripts. - Copy mount.sh to this folder. - Copy com.media.mount.plist to your user *Username*/Library/LaunchAgents folder. If the folder doesn't exist, create it. Step 2: Editing the mount script - Open mount.sh in text edit. Read the notes at the top of the script. - Enter your username and password inside the quotation marks where shown. Read the notes in the file if your password has symbols (eg @, as you'll need to url encode them). Site is given in the script. - Enter your server IP address (eg "192.168.0.100") and hostname (eg "tower") where shown. If your nas has a dynamic IP address (DHCP), enter the hostname instead of the IP Address. - Leave Mount point alone, unless you want the shares to mount somewhere other than the default /Volumes - Enter TRUE or FALSE if you want iTunes to open or not. - Enter the protocol you want to use, either smb or afp. - Enter the shares you want to mount. The shares must be space seperated (eg "TV Movies HD%20Movies". If the share name has a space in it, replace the space with %20 (eg "TV%20Shows"). Step 3: Enable script - Double check the settings are correct, and make sure the mount.sh, and com.media.mount.plist files are in the correct place. - Open Terminal (Applications/Utilities/Terminal). The sudo command will need your administrator password. Type: - sudo chown root:staff /Scripts/mount.sh - sudo chmod 775 /Scripts/mount.sh - Restart your computer. It should mount your shares on login, and check if they're mounted every one minute. If it's not working, double check permissions and settings. Try running the shell script by opening Terminal and typing: - /Scripts/mount.sh - Press enter If that works, then check the status of the launchd agent by going into Terminal and typing - launchctl list - This will display the loaded launch daemons. If there is a 1 next to the com.media.mount.plist file, make sure the script is located on your boot volume, "/Scripts/mount.sh". If it's not in the list at all, make sure that the plist in your user Library folder, in a folder called "LaunchAgents". Hope this is useful for someone! mount.zip
×
×
  • Create New...