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.

on-target 995B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/sh
  2. . gconfig
  3. TUSER=${DISTRO:-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 <username> run as <username> instead of ubuntu
  11. --env|-e "NAME=VALUE ..." modify the environment
  12. EOF
  13. }
  14. if [ $# != 0 ] ; then
  15. while true ; do
  16. case "$1" in
  17. --help|-h)
  18. usage
  19. exit 0
  20. ;;
  21. --user|-u)
  22. TUSER="$2"
  23. shift 2
  24. ;;
  25. --env|-e)
  26. ENV="$2"
  27. shift 2
  28. ;;
  29. --*)
  30. echo "unrecognized option $1"
  31. exit 1
  32. ;;
  33. *)
  34. break
  35. ;;
  36. esac
  37. done
  38. fi
  39. #if [ $# = 0 ] ; then
  40. # usage
  41. # exit 1
  42. #fi
  43. if [ -z "$USE_LXC" ]; then
  44. ssh -oConnectTimeout=30 -oNoHostAuthenticationForLocalhost=yes -i ${GITIAN_BASE:-.}/var/id_rsa -p $VM_SSH_PORT $TUSER@localhost $*
  45. else
  46. config-lxc
  47. sudo $LXC_EXECUTE -n gitian -f var/lxc.config -- sudo -u $TUSER $ENV -i -- $*
  48. fi