#!/bin/bash
source /home/.rvm/scripts/rvm

export PUMA_APP_DIR=/portalmec

source $PUMA_APP_DIR/config/env_vars.sh 2>/dev/null

option="${1}"

case ${option} in
   start)
      cd $PUMA_APP_DIR
      exec bundle exec sidekiq
      ;;
   stop)
       cd $PUMA_APP_DIR
       bundle exec sidekiqctl stop shared/pids/sidekiq.pid
      ;;
   *)
      echo "`basename ${0}`:usage: [start] | [stop]"
      exit 1 # Command to come out of the program with status 1
      ;;
esac
