Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/zsh
- ## config...
- sLocalMountPoint="$HOME/someMountpoint"
- sVMName="VMName"
- sHost="IPOrHostname";
- sShare="/NameOfSMBShare"
- sUser="Username"
- sPassword="Password"
- ## extended config...
- sProtocol="smb://"
- nPort=445;
- ## ensure that vBox is started...
- /Applications/VirtualBox.app/Contents/MacOS/VBoxManage startvm $sVMName --type headless &> /dev/null;
- ## wait for Samba on vBox...
- nc -z -G2 $sHost $nPort &> /dev/null;
- until [ $? -eq 0 ]; do
- sleep 2
- nc -z -G2 $sHost $nPort &> /dev/null;
- done;
- ## mount share if not already mounted...
- mount | grep $sShare || mount -t smbfs //$sUser:$sPassword@$sHost$sShare $sLocalMountPoint
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement