Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 10th, 2012  |  syntax: None  |  size: 2.26 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/bash
  2. #
  3. # Copyright (C) 2010 Brady Miller <brady@sparmy.com>
  4. #
  5. # This program is free software; you can redistribute it and/or
  6. # modify it under the terms of the GNU General Public License
  7. # as published by the Free Software Foundation; either version 2
  8. # of the License, or (at your option) any later version.
  9. #
  10. # Ubuntu script to prepare a github repository for testing. This is
  11. #  specifically to allow quick testing of new code, and is not for
  12. #  production use.
  13. #
  14. # This script will copy the current checked git repository into
  15. #  the web directory (and remove the currently installed openemr).
  16. # Place this script in the git directory (one level above the openemr
  17. #  directory).
  18. # Note you need to install openemr with the mysql user 'openemr' and
  19. #  the mysql database 'openemr' for this script to completely remove
  20. #  OpenEMR.
  21. # Also note the root mysql password needs to be blank for the mysql
  22. #  and mysqladmin commands to work.
  23. #
  24. # This script can also be used on your cvs checkout if you place it in
  25. #  the cvs directory (one directory above openemr)
  26. #
  27.  
  28. # Remove current test copy of openemr
  29. sudo rm -fr /var/www/openemr
  30.  
  31. # Remove current openemr mysql database
  32. sudo mysqladmin -f -h localhost -u root drop openemr
  33.  
  34. # Remove current openemr mysql user
  35. sudo mysql -f -u root -h localhost -e "DELETE FROM mysql.user WHERE User = 'openemr';FLUSH PRIVILEGES;"
  36.  
  37. # Copy the new openemr version to the web directory (note need to ignore the .git directory)
  38. sudo rsync --recursive --exclude .git openemr/* /var/www/openemr/
  39.  
  40. # modify permissions
  41. sudo chmod 666 /var/www/openemr/sites/default/sqlconf.php
  42. sudo chown -R www-data:www-data /var/www/openemr/sites/default/documents
  43. sudo chown -R www-data:www-data /var/www/openemr/sites/default/edi
  44. sudo chown -R www-data:www-data /var/www/openemr/sites/default/era
  45. sudo chown -R www-data:www-data /var/www/openemr/library/freeb
  46. sudo chown -R www-data:www-data /var/www/openemr/sites/default/letter_templates
  47. sudo chown -R www-data:www-data /var/www/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/compiled
  48. sudo chown -R www-data:www-data /var/www/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/cache
  49. sudo chown -R www-data:www-data /var/www/openemr/gacl/admin/templates_c
  50.  
  51. # Restart the mysql server
  52. sudo service mysql restart