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.

stop-target 774B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/sh
  2. VMSW=KVM
  3. if [ -n "$USE_LXC" ]; then
  4. VMSW=LXC
  5. elif [ -n "$USE_VBOX" ]; then
  6. VMSW=VBOX
  7. elif [ -n "$USE_DOCKER" ]; then
  8. VMSW=DOCKER
  9. fi
  10. case $VMSW in
  11. KVM)
  12. if [ ! -e var/target.pid ]; then exit; fi
  13. on-target -u root poweroff
  14. sleep 5
  15. if [ ! -e var/target.pid ]; then exit; fi
  16. sleep 5
  17. if [ ! -e var/target.pid ]; then exit; fi
  18. echo Killing target since it did not shutdown within 10 seconds
  19. kill `cat var/target.pid`
  20. ;;
  21. LXC)
  22. true
  23. ;;
  24. VBOX)
  25. if [ ! -e var/target.vmname ]; then exit; fi
  26. VBoxManage controlvm `cat var/target.vmname` savestate
  27. rm var/target.vmname
  28. ;;
  29. DOCKER)
  30. docker container stop gitian-target > /dev/null
  31. docker container rm gitian-target > /dev/null
  32. ;;
  33. esac