Skip to content

Instantly share code, notes, and snippets.

@shigemk2
Created September 8, 2014 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shigemk2/a34230061a1fb2dd2da4 to your computer and use it in GitHub Desktop.
Save shigemk2/a34230061a1fb2dd2da4 to your computer and use it in GitHub Desktop.
#!/bin/bash
MIKUTTER=$HOME/projects/mikutter
mstart() {
echo "Starting mikutter: "
echo $MIKUTTER
ruby $MIKUTTER/mikutter.rb &
cd $MIKUTTER && touch MIKU_PID
echo "Saving mikutter's process: "
ps aux | grep mikutter.rb | grep -v grep | awk '{print $2}' > MIKU_PID
}
mstop() {
echo -n "Stopping mikutter: "
cd $MIKUTTER && cat MIKU_PID | xargs kill -9
cd $MIKUTTER && rm MIKU_PID
}
case "$1" in
start)
mstart
;;
stop)
mstop
;;
restart)
mstop
mstart
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment