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.

87 lines
1.8 KiB

  1. #!/bin/bash
  2. #
  3. BORDER="~~~~~~~~~~~~~~~~~~~~~~~~~~~"
  4. NUM_RUNNING=$(vboxmanage list runningvms | wc -l)
  5. echo Number of running vms: $NUM_RUNNING
  6. if [ $NUM_RUNNING -eq 6 ]
  7. then
  8. echo Sike all 6 vms already running
  9. else
  10. echo Bringing up all the VMs..
  11. printf "$BORDER Starting all 3 routers \n"
  12. printf "\n$BORDER Booting router 1 \n"
  13. cd routers/router1
  14. #vagrant resume
  15. vboxmanage startvm vague-router1 --type headless
  16. echo "$BORDER Finished booting router 1"
  17. printf "\n$BORDER Booting router 2 \n"
  18. cd ../router2
  19. #vagrant resume
  20. vboxmanage startvm vague-router2 --type headless
  21. echo "$BORDER Finished booting router 2"
  22. printf "\n$BORDER Booting router 3 \n"
  23. cd ../router3
  24. #vagrant resume
  25. vboxmanage startvm vague-router3 --type headless
  26. echo "$BORDER Finished booting router 3"
  27. printf "\n$BORDER Booting gateway \n"
  28. cd ../gateway
  29. #vagrant resume
  30. vboxmanage startvm vague-gateway --type headless
  31. printf "$BORDER Finished booting gateway\n\n"
  32. cd ../..
  33. sleep 1
  34. RUNNERS=$(vboxmanage list runningvms)
  35. echo "Current running VMs: $RUNNERS"
  36. printf "\n\n$BORDER Booting the 3 edge nodes .. \n"
  37. printf "\n$BORDER Booting the client \n"
  38. cd edgers/client
  39. #vagrant resume
  40. vboxmanage startvm vague-client --type headless
  41. echo "$BORDER Finished booting client.."
  42. printf "\n$BORDER Booting the vpn server \n"
  43. cd ../vpn-server
  44. #vagrant resume
  45. vboxmanage startvm vague-vpn-server --type headless
  46. echo "$BORDER Finished booting vpn server.."
  47. printf "\n$BORDER Booting the web server \n"
  48. cd ../web-server
  49. vboxmanage startvm vague-web-server --type headless
  50. printf "\n\n$BORDER Checking current VM status..\n\n"
  51. RUNNERS=$(vboxmanage list runningvms)
  52. echo "Current running VMs: $RUNNERS"
  53. fi