Skip to content

Instantly share code, notes, and snippets.

@sachin21
Last active Nov 9, 2016
Embed
What would you like to do?
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