cleanup.sh 251 B

12345678910111213141516171819
  1. #!/bin/bash
  2. readonly TMPFILE="$(mktemp)"
  3. cleanup() {
  4. # It's the right place to:
  5. # - remove temporary files
  6. # - restart services
  7. # - ..
  8. rm -f "$TMPFILE"
  9. exit 0
  10. }
  11. trap cleanup EXIT SIGINT
  12. #
  13. # Your script goes here..
  14. #