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 603B

123456789101112131415161718192021222324252627282930313233
  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. fi
  8. case $VMSW in
  9. KVM)
  10. if [ ! -e var/target.pid ]; then exit; fi
  11. on-target -u root halt
  12. sleep 5
  13. if [ ! -e var/target.pid ]; then exit; fi
  14. sleep 5
  15. if [ ! -e var/target.pid ]; then exit; fi
  16. echo Killing target since it did not shutdown within 10 seconds
  17. kill `cat var/target.pid`
  18. ;;
  19. LXC)
  20. true
  21. ;;
  22. VBOX)
  23. if [ ! -e var/target.vmname ]; then exit; fi
  24. VBoxManage controlvm `cat var/target.vmname` savestate
  25. rm var/target.vmname
  26. ;;
  27. esac