Advertisement
Guest User

Untitled

a guest
Jun 12th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #!/bin/zsh
  2.  
  3. ## config...
  4. sLocalMountPoint="$HOME/someMountpoint"
  5. sVMName="VMName"
  6. sHost="IPOrHostname";
  7. sShare="/NameOfSMBShare"
  8. sUser="Username"
  9. sPassword="Password"
  10.  
  11. ## extended config...
  12. sProtocol="smb://"
  13. nPort=445;
  14.  
  15. ## ensure that vBox is started...
  16. /Applications/VirtualBox.app/Contents/MacOS/VBoxManage startvm $sVMName --type headless &> /dev/null;
  17.  
  18. ## wait for Samba on vBox...
  19. nc -z -G2 $sHost $nPort &> /dev/null;
  20. until [ $? -eq 0 ]; do
  21. sleep 2
  22. nc -z -G2 $sHost $nPort &> /dev/null;
  23. done;
  24.  
  25. ## mount share if not already mounted...
  26. mount | grep $sShare || mount -t smbfs //$sUser:$sPassword@$sHost$sShare $sLocalMountPoint
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement