Skip to content

Instantly share code, notes, and snippets.

@sachin21
Last active November 9, 2016 06:42
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 sachin21/82bf9e1f0e2ae6412af88ccda56b4a21 to your computer and use it in GitHub Desktop.
Save sachin21/82bf9e1f0e2ae6412af88ccda56b4a21 to your computer and use it in GitHub Desktop.
mikutter startup script
#!/usr/bin/env zsh
eval "$(rbenv init - zsh)"
export MIKUTTER=$HOME/Projects/github.com/mikutter/mikutter
mstart() {
echo "Starting mikutter..."
ruby $MIKUTTER/mikutter.rb &> /tmp/MIKU_LOG &
ps aux | fgrep mikutter.rb | fgrep -v grep | awk '{print $2}' > /tmp/MIKU_PID
}
mstop() {
echo "Stopping mikutter..."
cat /tmp/MIKU_PID | xargs kill -9
}
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