mvd_transfer.sh 769 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env bash
  2. # small transfer script by Shaque 2012-11-22
  3. # and more changes done by lots of people over the course ;)
  4. mvd="$1"
  5. game="$2"
  6. _file="$game/demos/$mvd"
  7. # here, someuser@aq2world.com is the target user and host, change that to your needs.
  8. _targetuserhost="someuser@aq2world.com"
  9. # here, demos/ is the target directory, change that to your needs.
  10. _targetdir="demos/"
  11. if [ -f "$_file" ]; then
  12. ( sleep 2 ) && ( echo "put $_file '$_targetdir'" | sftp -q -o PasswordAuthentication=no -p $_targetuserhost ) &
  13. # sleep a little, so q2proded has time to finalize the demo file
  14. else
  15. echo "$0 Error: '$_file' not found. Not transferring anything. :("
  16. fi
  17. # vim: expandtab tabstop=2 autoindent:
  18. # kate: space-indent on; indent-width 2; mixedindent off;