/etckeeper/init.d/20restore-etckeeper

http://github.com/brinkman83/bashrc · Shell · 22 lines · 14 code · 3 blank · 5 comment · 2 complexity · 776ab5b122b16e71b155680a3a6d3189 MD5 · raw file

  1. #!/bin/sh
  2. set -e
  3. # Used by .etckeeper to run a command if the file it acts on
  4. # (the last parameter) exists.
  5. maybe () {
  6. command="$1"
  7. shift 1
  8. if eval [ -e "\$$#" ]; then
  9. "$command" "$@"
  10. fi
  11. }
  12. # Yes, this runs code from the repository. As documented, etckeeper-init
  13. # should only be run on repositories you trust.
  14. if [ -e .etckeeper ]; then
  15. . ./.etckeeper
  16. else
  17. touch .etckeeper
  18. chmod 600 .etckeeper
  19. fi