mostly filebased Content Presentation System
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

63 lines
1.6KB

  1. #!/bin/bash
  2. USER=root
  3. SERVER=brain.norganoid.com
  4. LIVE_DIR=../var/www/norganoid.at/
  5. DEV_DIR=../var/www/dev.norganoid.at/
  6. CONTENT=content/
  7. ERROR="Error. Please make sure you've indicated correct parameters"
  8. if [ $# -eq 0 ]
  9. then
  10. echo $ERROR;
  11. exit 1
  12. elif [ $1 == "dev" ]
  13. then
  14. DIR=$DEV_DIR
  15. elif [ $1 == "live" ]
  16. then
  17. DIR=$LIVE_DIR
  18. else
  19. echo $ERROR
  20. exit 1
  21. fi
  22. if [[ -z $2 ]]
  23. then
  24. echo "Running App Sync (dry-run)"
  25. rsync --dry-run -az --force --delete --progress --exclude-from=.rsyncignore ./ $USER@$SERVER:$DIR;
  26. elif [[ $2 == "go" ]]
  27. then
  28. echo "Running App Sync"
  29. rsync -az --force --delete --progress --exclude-from=.rsyncignore ./ $USER@$SERVER:$DIR;
  30. elif [[ $2 == "content" ]]
  31. then
  32. if [[ -z $3 ]]
  33. then
  34. echo "Fetching Content (dry-run)"
  35. rsync --dry-run -azv --force --delete --progress --exclude-from=.rsyncignore $USER@$SERVER:$DIR$CONTENT ./$CONTENT;
  36. echo "done"
  37. elif [[ $3 == "go" ]]
  38. then
  39. echo "Fetching Content"
  40. rsync -azv --force --delete --progress --exclude-from=.rsyncignore $USER@$SERVER:$DIR$CONTENT ./$CONTENT;
  41. echo "done"
  42. elif [[ $3 == "up" ]]
  43. then
  44. if [[ -z $4 ]]
  45. then
  46. echo "Uploading Content (dry-run)"
  47. rsync --dry-run -azv --progress --exclude-from=.rsyncignore ./$CONTENT $USER@$SERVER:$DIR$CONTENT;
  48. echo "done"
  49. elif [[ $4 == "go" ]]
  50. then
  51. echo "Uploading Content"
  52. rsync -azv --progress --exclude-from=.rsyncignore ./$CONTENT $USER@$SERVER:$DIR$CONTENT;
  53. echo "done"
  54. fi
  55. fi
  56. fi