Share Pastebin
Guest
Public paste!

grouse

By: a guest | Jun 2nd, 2008 | Syntax: Bash | Size: 0.39 KB | Hits: 76 | Expires: Never
Copy text to clipboard
  1. #!/usr/bin/env bash
  2.  
  3. # examples:
  4. # dropoff
  5. # ~/.pickup/* -> .
  6.  
  7. # dropoff server
  8. # server:~/.pickup/* -> .
  9.  
  10. # dropoff server target
  11. # server:~/.pickup/* -> target
  12.  
  13. # XXX: warning, will not work if $PICKUPDIR is set differently on other system
  14.  
  15. _PICKUPDIR="~/.pickup"
  16.  
  17. if [ $1 ]; then
  18.     scp -r "${1}:${_PICKUPDIR}/*" "${2:-.}"
  19. else
  20.     cp --dereference -prv "${_PICKUPDIR}/*" .
  21. fi