#!/bin/sh # check if systemctl exists echo 'check, if mongodb is running' if([ -f /usr/bin/systemctl ]); then # check if mongodb is running if([ `systemctl status mongodb | grep Active | grep dead | wc -l` == 1 ]); then echo 'is not running, starting' sudo systemctl start mongodb else echo 'mongodb is running' fi else echo 'sorry, no systemctl found, trying to run although' fi # let grunt run in another window gruntCommand="grunt watch; sleep 5;" if([ `ps aux | grep "$gruntCommand" | wc -l` -eq 1 ]); then echo 'starting grunt in another xterm window' xterm -e "$gruntCommand" & else echo "grunt is running, though not starting" fi # let django run djangoCommand="python3 manage.py runserver" if([ `ps aux | grep "$djangoCommand" | wc -l` -eq 1 ]); then remoteVar="" if([ "$1" = "remote" ]); then remoteVar=" 0.0.0.0:8000" fi echo "starting django server in another xterm window" xterm -e "python2 manage.py runserver $remoteVar" & else echo "django is running, though not starting" fi