Permalink
Browse files

initiali import

Signed-off-by: Chris Granger <ibdknox@gmail.com>
  • Loading branch information...
0 parents commit c977bc988e82754af0c993a072aff5f4c5e2a6c6 @ibdknox committed Jan 7, 2012
Showing with 29 additions and 0 deletions.
  1. +22 −0 jackin
  2. +7 −0 killc
22 jackin
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+name="jackin"
+pidfile=~/.run/jackin.pid
+
+if [ -f "$pidfile" ]; then
+ pid=`cat $pidfile`
+ running=`ps p $pid |wc -l`
+ if [ $running -eq 1 ]; then
+ pid=
+ fi
+else
+ pid=
+fi
+
+if [ "$pid" != "" ]; then
+ echo Stopping $name $pid
+ killc $pid
+ rm $pidfile
+fi
+lein nailgun &
+echo $! > $pidfile
7 killc
@@ -0,0 +1,7 @@
+pid=$1
+for child in $(ps -o pid,ppid -ax | \
+ awk "{ if ( \$2 == $pid ) { print \$1 }}")
+do
+ echo "Killing child process $child because ppid = $pid"
+ kill $child
+done

0 comments on commit c977bc9

Please sign in to comment.