Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env /usr/local/bin/fish
- set server "smb://Drive"
- set DriveA $server"/DriveA"
- set DriveB $server"/DriveB"
- function unmount_rmdir
- if test -d "$argv[1]"
- diskutil unmount $argv[1]
- rmdir $argv[1]
- end
- end
- function mkdir_mount
- if ! test -d "$argv[1]/$argv[3]"
- if ! test -d "$argv[1]"
- mkdir "$argv[1]"
- end
- mount -t smbfs "$argv[2]" "$argv[1]"
- end
- end
- if ! test -w "/Volumes"
- /usr/bin/osascript -e 'do shell script "chmod 777 /Volumes && chown me /Volumes" with administrator privileges'
- end
- unmount_rmdir /Volumes/DriveB-1
- unmount_rmdir /Volumes/DriveB-2
- unmount_rmdir /Volumes/DriveA-1
- unmount_rmdir /Volumes/Drive-2
- mkdir_mount /Volumes/DriveA $DriveA Pictures
- mkdir_mount /Volumes/DriveA $DriveB Documents
- killall Dock
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement