# HG changeset patch # User Jittat Fakcharoenphol # Date 2014-08-24 02:28:24 # Node ID eb52412d0a7d1214cb47c596b4a1392f3bb90d31 # Parent 3568b88e10dbc83c782976a38a0097231674478e # Parent e7c1be9b6989dc9b96bf74e0108ba3b353a15870 Merge pull request #5 from nattee/master update install script diff --git a/installer/install.sh b/installer/install.sh --- a/installer/install.sh +++ b/installer/install.sh @@ -37,6 +37,18 @@ cp web/config/application.rb.SAMPLE web/config/application.rb cp web/config/initializers/cafe_grader_config.rb.SAMPLE web/config/initializers/cafe_grader_config.rb +#replace UTC in application.rb with the system timezone +timezone='UTC' +if [ -f '/etc/timezone' ]; then + timezone=\"`cat /etc/timezone`\" +else + if [ -f '/etc/sysconfig/clock' ]; then + timezone=`grep -e '^TIMEZONE' /etc/sysconfig/clock | grep -o -e '\".*\"'` + fi +fi +replace="s!'UTC'!$timezone!g" +sed -i $replace web/config/application.rb + echo "At this point we will need MySQL user and database." echo "Have you created MySQL user and database for Cafe grader? (Y/N) " read ch @@ -114,6 +126,10 @@ rake db:migrate rake db:seed +echo "Running rake tasks to precompile the assets" + +rake assets:precompile + echo "Intalling web interface complete..." echo echo "Fetching grader"