Skip to content

Instantly share code, notes, and snippets.

@nephthys
Created July 1, 2019 23:07
Show Gist options
  • Save nephthys/5c83f836729c2d32fe2d229cf1395997 to your computer and use it in GitHub Desktop.
Save nephthys/5c83f836729c2d32fe2d229cf1395997 to your computer and use it in GitHub Desktop.
Mount SMB shares at the beginning of the session on macOS

nano ~/Library/LaunchAgents/com.user.loginscript.automount.plist

launchctl load ~/Library/LaunchAgents/com.user.loginscript.automount.plist

#!/bin/bash
osascript -e "mount volume \"smb://user@SERVER/Folder\""
osascript -e "mount volume \"smb://user@SERVERBIS/FolderBis\""
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.user.loginscript.automount</string>
<key>ProgramArguments</key>
<array><string>/Users/USER/.scripts/automount.sh</string></array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment