From 871472d93d204d7bb404cc346b3dbb3c51be1ee9 Mon Sep 17 00:00:00 2001 From: Matt Broyles Date: Mon, 16 May 2016 20:17:47 -0500 Subject: [PATCH 1/3] Added function to kill daemonized rails server --- lib/killrails.bash | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 lib/killrails.bash diff --git a/lib/killrails.bash b/lib/killrails.bash new file mode 100644 index 00000000..00b4e3a5 --- /dev/null +++ b/lib/killrails.bash @@ -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 +} \ No newline at end of file From 05385d43d702b05faa381b1977e03b02429f9e19 Mon Sep 17 00:00:00 2001 From: Matt Broyles Date: Tue, 17 May 2016 16:10:54 -0500 Subject: [PATCH 2/3] Moved killrails to plugins, added newline, added meta information, cut indentation to 2 spaces. --- lib/killrails.bash | 11 ----------- plugins/available/killrails.plugin.bash | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 11 deletions(-) delete mode 100644 lib/killrails.bash create mode 100644 plugins/available/killrails.plugin.bash diff --git a/lib/killrails.bash b/lib/killrails.bash deleted file mode 100644 index 00b4e3a5..00000000 --- a/lib/killrails.bash +++ /dev/null @@ -1,11 +0,0 @@ -# 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 -} \ No newline at end of file diff --git a/plugins/available/killrails.plugin.bash b/plugins/available/killrails.plugin.bash new file mode 100644 index 00000000..2c8d2779 --- /dev/null +++ b/plugins/available/killrails.plugin.bash @@ -0,0 +1,15 @@ +cite about-plugin +about-plugin 'Function to kill a daemonized Rails server.' + +# 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" + return 1 + fi +} From 76d026f2adb89a1edf3ba9896f009c379df7a78a Mon Sep 17 00:00:00 2001 From: Matt Broyles Date: Wed, 18 May 2016 09:33:12 -0500 Subject: [PATCH 3/3] added about and group metadata --- plugins/available/killrails.plugin.bash | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/available/killrails.plugin.bash b/plugins/available/killrails.plugin.bash index 2c8d2779..21983f82 100644 --- a/plugins/available/killrails.plugin.bash +++ b/plugins/available/killrails.plugin.bash @@ -3,6 +3,9 @@ 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}"