Permalink
Browse files

run.sh autostarts redis-server

run.sh guarantees that redis-server is running before starting the web
server: if it's already running, then nothing will be done.
  • Loading branch information...
1 parent 34b4561 commit 488427f4da784d2a15bd0720e11624a31f159b38 @jpaugh jpaugh committed Feb 18, 2012
Showing with 10 additions and 2 deletions.
  1. +2 −0 README
  2. +8 −2 run.sh
View
2 README
@@ -33,6 +33,8 @@ Run the following command to start the webserver:
$ ./run.sh
+This also starts redis-server, if that's not already running.
+
By default, the website is hosted at http://localhost:8000, but if you need to
change the port number, use the PORT environment variable. Note that PORT must
be either a number or unset.
View
10 run.sh
@@ -1,2 +1,8 @@
-#!/bin/sh
-exec lein run -m testify.core
+#!/bin/bash
+APPDIR=$(dirname $0)
+if [[ -z $(pidof redis-server) ]]; then
+ echo "Starting Redis server"
+ redis-server $APPDIR/redis/redis.conf >/dev/null&
+fi
+echo "Starting web server"
+exec lein run -m testify.core

0 comments on commit 488427f

Please sign in to comment.