You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

copy-to-target 717B

10 년 전
1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/sh
  2. . gconfig
  3. TUSER=ubuntu
  4. usage() {
  5. echo "Usage: ${0##*/} [OPTION]... <command>"
  6. echo "Run command on build target."
  7. echo
  8. cat << EOF
  9. --help display this help and exit
  10. --user=U run as U instead of ubuntu
  11. EOF
  12. }
  13. if [ $# != 0 ] ; then
  14. while true ; do
  15. case "$1" in
  16. --help|-h)
  17. usage
  18. exit 0
  19. ;;
  20. --user|-u)
  21. TUSER="$2"
  22. shift 2
  23. ;;
  24. --*)
  25. echo "unrecognized option $1"
  26. exit 1
  27. ;;
  28. *)
  29. break
  30. ;;
  31. esac
  32. done
  33. fi
  34. if [ $# = 0 ] ; then
  35. usage
  36. exit 1
  37. fi
  38. scp -oConnectTimeout=2 -oNoHostAuthenticationForLocalhost=yes -i ${GITIAN_BASE:-.}/var/id_dsa -P $VM_SSH_PORT $1 $TUSER@localhost:$2