daily pastebin goal
17%
SHARE
TWEET

Bash Script to Upgrade Open Atrium

timbridge May 16th, 2016 17 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. docroot=$1
  3. upgrade_tar=$2
  4. if [[ "$2" -ne 1 ]]; then
  5.     echo "$0: Usage: [docroot directory name] [upgrade_oa.sh path_to_tar]"
  6.     exit 1;
  7. fi
  8. echo "Downloading tar:$1"
  9. curl $2 | tar xz
  10. echo "Successfully downloaded tar"
  11. echo "-------------------"
  12. echo "Backing up and replacing docroot with new Open Atrium core"
  13. mv $1/ old
  14. mv openatrium-7.x*/ $1
  15. echo "New Open Atrium Core in place"
  16. echo "------------------"
  17. echo "Removing new core's sites directory"
  18. rm -rf $1/sites
  19. echo "Restoring sites directory with backup"
  20. mv old/sites/ $1
  21. echo "Successfully restored sites directory from backup"
  22. echo "------------------"
  23. echo "Restoring dotfiles, robots, favicon, and simplesaml from backup"
  24. mv old/.htaccess $1
  25. mv old/.gitignore $1
  26. mv old/robots.txt $1
  27. mv old/robots-dev.txt $1
  28. mv old/favicons_etc/ $1
  29.  
  30. mv old/simplesaml $1
  31. echo "Successfully restored dotfiles, robots, favicon, and simplesaml from backup"
  32. echo "------------------"
  33. echo "Removing backup and tar..."
  34. rm -rf old/
  35. echo "Successfully removed backup."
  36. echo "Open Atrium has been upgraded."
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top