Guest User

Untitled

a guest
Oct 17th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # download or upload files
  4. # download : dl
  5. # upload : up
  6. action=$1
  7. user=USER
  8. pass=PASS
  9. host=HOST
  10. cmd="mount volume \"afp://${user}:${pass}@${host}/${user}\""
  11. src_local=~/Documents/OmniOutliner/
  12. src_server=/Volumes/$user/OmniOutliner/
  13.  
  14. # echo "${cmd}"
  15.  
  16. function download {
  17. rsync -azv --delete $src_server $src_local
  18. }
  19. function upload {
  20. rsync -azv --delete $src_local $src_server
  21. }
  22.  
  23.  
  24. if [ ! -d /Volumes/$user ]; then
  25. osascript -e "${cmd}"
  26. fi
  27.  
  28. case $action in
  29. dl | download)
  30. download
  31. ;;
  32. up | upload)
  33. upload
  34. ;;
  35. * )
  36. echo "Wrong argument. Pass dl or up"
  37. ;;
  38. esac
Add Comment
Please, Sign In to add comment