fixes to init script

This commit is contained in:
ruby
2017-05-09 15:11:28 +02:00
parent 61c5624b16
commit c53d34191a

View File

@@ -1,7 +1,7 @@
#! /bin/bash #! /bin/bash
ruby_command="ruby" ruby_command="ruby"
rake_command="rake" rake_command="rake"
bundler_command="bundler" bundler_command="bundle"
# Are the necessary programs installed? # Are the necessary programs installed?
command -v $ruby_command >/dev/null 2>&1 || { echo >&2 "The given ruby command does not exist. Please change the command or install ruby"; exit 1; } command -v $ruby_command >/dev/null 2>&1 || { echo >&2 "The given ruby command does not exist. Please change the command or install ruby"; exit 1; }
@@ -17,11 +17,11 @@ cp -u config/omniauth_secrets.yml.example config/omniauth_secrets.yml
echo "Bundle install..." echo "Bundle install..."
# Run Bundler # Run Bundler
$bundler_command install || {echo "Bundler failed. Please run \"$bundle\_command install\" seperately and debug the errors, before running this script again";exit 1;} $bundler_command install || { echo "Bundler failed. Please run \"$bundle\_command install\" seperately and debug the errors, before running this script again";exit 1; }
echo "Migrate the database..." echo "Migrate the database..."
# Run the migration # Run the migration
$rake_command db:migrate ||{echo "Migration failed. Please run \"$rake\_command db:migrate\" seperately and debug the errors, before running this script again"; exit 1;} $rake_command db:migrate || { echo "Migration failed. Please run \"$rake\_command db:migrate\" seperately and debug the errors, before running this script again"; exit 1; }
echo "Start the sunspot server" echo "Start the sunspot server"
# Run Sunspot # Run Sunspot
@@ -34,7 +34,7 @@ if [ ! -f config/start_topic.yml ]; then
echo "1" > config/start_topic.yml echo "1" > config/start_topic.yml
fi fi
# Generate fetadmin user "admin@fet.at", password: 12345678 touch config/crawl_config.yml