run_interactive.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #!/bin/bash
  2. export DEBUG="1"
  3. #export uname="bus"
  4. export uname="root"
  5. export mountdir="$1"
  6. export SSH_DEFAULT_PORT="6055"
  7. export AVLS_DAEMON_PORT="2857"
  8. export PASSDB_DAEMON_PORT="7277"
  9. export BILLDB_DAEMON_PORT="2455"
  10. export HELLO_DAEMON_PORT="3556"
  11. export UPDATE_DAEMON_PORT="8377"
  12. export DEBUG_PORT="5000"
  13. export mountparam=""
  14. if [[ "$mountdir" != "" ]] ; then
  15. mountparam="-v $mountdir:/data"
  16. echo "$mountparam"
  17. fi
  18. ## for interactive debugging...
  19. ##
  20. if [[ "$uname" == "root" ]] ; then
  21. if [[ "$DEBUG" == "1" ]] ; then
  22. docker run $mountparam \
  23. -p $DEBUG_PORT:$DEBUG_PORT \
  24. -p 8080:80 \
  25. -p 4430:443 \
  26. -p $SSH_DEFAULT_PORT:22 \
  27. -p $AVLS_DAEMON_PORT:$AVLS_DAEMON_PORT \
  28. -p $PASSDB_DAEMON_PORT:$PASSDB_DAEMON_PORT \
  29. -p $BILLDB_DAEMON_PORT:$BILLDB_DAEMON_PORT \
  30. -p $HELLO_DAEMON_PORT:$HELLO_DAEMON_PORT \
  31. -p $UPDATE_DAEMON_PORT:$UPDATE_DAEMON_PORT \
  32. -it popufare \
  33. /bin/bash
  34. else
  35. docker run \
  36. -p 8080:80 \
  37. -p 4430:443 \
  38. -p $SSH_DEFAULT_PORT:22 \
  39. -p $AVLS_DAEMON_PORT:$AVLS_DAEMON_PORT \
  40. -p $PASSDB_DAEMON_PORT:$PASSDB_DAEMON_PORT \
  41. -p $BILLDB_DAEMON_PORT:$BILLDB_DAEMON_PORT \
  42. -p $HELLO_DAEMON_PORT:$HELLO_DAEMON_PORT \
  43. -p $UPDATE_DAEMON_PORT:$UPDATE_DAEMON_PORT \
  44. -it popufare \
  45. /bin/bash
  46. fi
  47. else
  48. docker run $mountparam \
  49. -p 8080:80 \
  50. -p 4430:443 \
  51. -p $SSH_DEFAULT_PORT:22 \
  52. -p $AVLS_DAEMON_PORT:$AVLS_DAEMON_PORT \
  53. -p $PASSDB_DAEMON_PORT:$PASSDB_DAEMON_PORT \
  54. -p $BILLDB_DAEMON_PORT:$BILLDB_DAEMON_PORT \
  55. -p $HELLO_DAEMON_PORT:$HELLO_DAEMON_PORT \
  56. -p $UPDATE_DAEMON_PORT:$UPDATE_DAEMON_PORT \
  57. -it popufare \
  58. bash -c " service ssh start && su - bus "
  59. fi