Last active
November 9, 2016 06:42
-
-
Save sachin21/82bf9e1f0e2ae6412af88ccda56b4a21 to your computer and use it in GitHub Desktop.
mikutter startup script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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