#!/bin/bash
[ -f /etc/profile.d/lang.sh ] && source /etc/profile.d/lang.sh
[ -f /etc/profile.d/railsenv.sh ] && source /etc/profile.d/railsenv.sh
[ -f /etc/profile.d/rbenv.sh ] && source /etc/profile.d/rbenv.sh
[ -f /etc/profile.d/proxy.sh ] && source /etc/profile.d/proxy.sh
[ -f /etc/profile.d/timezone.sh ] && source /etc/profile.d/timezone.sh
cd /var/lib/redmine
bundle exec ruby /var/lib/redmine/plugins/sidfm-vm-server/ROR/bin/db_manage.rb $*
if [ "x$*" == "xinit" ]; then
    bundle exec rake db:migrate
    bundle exec rake redmine:plugins:migrate
fi
