Merge pull request #720 from MattBroyles/master

Added function to kill daemonized rails server
pull/722/head
Nils Winkler 2016-05-19 09:00:25 +02:00
commit deab0b58a3
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
cite about-plugin
about-plugin 'Function to kill a daemonized Rails server.'
# Quick function to kill a daemonized Rails server
function killrails() {
about 'Searches for a daemonized Rails server in tmp/pids and attempts to kill it.'
group 'server'
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"
return 1
fi
}