I am writing a shell script where i i am checking for redis process and then if redis is not running i am doing "foreman start" after that running my "RAILS" start command as below in a shell script.
Problem i am facing is, when script executes "foreman start" command, the process cant be killed and its not going to RAILS command. How do i achieve it in shell script.
!/bin/sh
REDISPID=ps -eaf | grep redis | grep -v grep | awk '{print $2}'
echo "###### REDIS $REDISPID ###########3" if [[ "" != "$REDISPID" ]]; then echo "**** Redis is running, REDIS is FINE $REDISPID **** " else echo "**** Redis is not Running!!!, run foreman start command ***** " foreman start fi
RAILS_ENV=production bundle exec rake assets:precompile;bundle exec rails s puma -d -p 3100 -e production
Aucun commentaire:
Enregistrer un commentaire