/core/externals/update-engine/Samples/EngineRunner/engine_install

http://macfuse.googlecode.com/ · #! · 28 lines · 23 code · 5 blank · 0 comment · 0 complexity · a389d6815c71f68e9d599234ef6435ec MD5 · raw file

  1. #!/bin/bash
  2. # Copy the disk image's executable over the existing EngineRunner
  3. # executable. This is safe to do. The old executable is still open
  4. # and mapped, so won't be disturbed. It doesn't load any resources
  5. # either.
  6. # Make sure we have the KS_TICKET_XC_PATH enviornment variable.
  7. # This is taken from the ticket.
  8. if [ "${KS_TICKET_XC_PATH:=undefined}" = "undefined" ]; then
  9. echo "D'oh! The ticket doesn't have an existence checker path."
  10. echo "That path is used to figure out which EngineRunner to update"
  11. exit 1
  12. else
  13. # Run the copy.
  14. cp "$1/EngineRunner" "${KS_TICKET_XC_PATH}"
  15. # Did it succeed?
  16. if [ $? != 0 ]; then
  17. echo "D'oh! Copy command to ${KS_TICKET_XC_PATH} failed."
  18. echo "Are the destination permissions ok?"
  19. exit 1
  20. fi
  21. fi
  22. # Happiness and light.
  23. exit 0