cpio 487 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env bash
  2. # This file is part of the OpenADK project. OpenADK is copyrighted
  3. # material, please see the LICENCE file in the top-level directory.
  4. opt=
  5. user="-R 0:0"
  6. os=$(uname)
  7. case $os in
  8. NetBSD|MirBSD|OpenBSD)
  9. quiet=""
  10. ;;
  11. Darwin)
  12. user="-R root:wheel"
  13. quiet=""
  14. ;;
  15. *)
  16. quiet="--quiet"
  17. ;;
  18. esac
  19. if [ "$2" = "r" ];then
  20. opt=$user
  21. fi
  22. cmd=$(echo "$@"|sed -e "s# r ##")
  23. if [ -x /usr/bin/cpio ];then
  24. /usr/bin/cpio $quiet $opt $cmd
  25. else
  26. /bin/cpio $quiet $opt $cmd
  27. fi