getwoof 837 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. #120801 download Woof.
  3. #this code is clumsy, had to checkout, then set some parameters in repo, then erase and checkout again.
  4. #One optional parameter, 'update'.
  5. if [ $1 ];then
  6. case $1 in
  7. *update)
  8. [ ! -d woofx ] && exit 2
  9. cd woofx
  10. git pull
  11. ;;
  12. *help)
  13. echo "Current directory must be in a Linux filesystem."
  14. echo "The Woof repository will be checked-out into directory 'woofx'."
  15. echo "Option passed parameter 'update' will update 'woofx' from the online
  16. Woof repository directory."
  17. ;;
  18. esac
  19. exit 0
  20. fi
  21. # download woof-CE's code
  22. git="$(which git)"
  23. if [ -n "$git" ]
  24. then
  25. "$git" clone https://github.com/puppylinux-woof-CE/woof-CE.git woofx
  26. else
  27. zip="$(mktemp -u)"
  28. wget -O "$zip" https://github.com/puppylinux-woof-CE/woof-CE/archive/master.zip
  29. unzip "$zip"
  30. rm -f "$zip"
  31. mv woof-CE-master woofx
  32. fi