Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 23 lines (20 sloc) 589 Bytes
#!/bin/bash
forever restart app.js
OLD_CONTENTS=`cat *.js */*.js`
NEW_CONTENTS=`cat *.js */*.js`
while [ true ]
do
NEW_CONTENTS=`cat *.js */*.js`
if [ "$OLD_CONTENTS" != "$NEW_CONTENTS" ]; then
# Assert: code has changed. Bounce server.
OLD_CONTENTS=$NEW_CONTENTS
echo "Bouncing server..."
forever restart app.js
# PID=`ps -a | grep node | grep -o \\[0-9\\]\\\+ | head -1`
# kill $PID
# node app.js &
# PID=`ps -a | grep node | grep -o \\[0-9\\]\\\+ | head -1`
# echo "PID = ${PID}"
fi
sleep 5
done