Added function to kill daemonized rails server

This commit is contained in:
Matt Broyles
2016-05-16 20:17:47 -05:00
parent 13b643e93e
commit 871472d93d

11
lib/killrails.bash Normal file
View File

@@ -0,0 +1,11 @@
# Quick function to kill a daemonized Rails server
function killrails() {
railsPid="$(cat tmp/pids/server.pid)"
if [ ! -z "$railsPid" ]; then
echo "[OK] Rails Server Process Id : ${railsPid}"
kill -9 $railsPid
echo "[OK] Process Killed"
else
echo "[FAIL] Error killing Rails server"
fi
}