Skip to content

Instantly share code, notes, and snippets.

@3100
Last active December 12, 2015 06:19
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 3100/4728785 to your computer and use it in GitHub Desktop.
Save 3100/4728785 to your computer and use it in GitHub Desktop.
Reboot hubot. This script helps you to reboot hubot by hubot script with child_process.
#!/bin/bash
HUBOT_DIR="/your/hubot/home"
HUBOT_BIN="bin/hubot"
HUBOT_RC=".hubotrc"
HUBOT_OPTION="-n / -a hubot-adapter"
HUBOT_LOG="hubot.log"
cd $HUBOT_DIR
TEXT=`ps a | grep $HUBOT_BIN | head -n 1|`
IFS=' '
set -- $TEXT
kill -9 $1
. $HUBOT_RC
$HUBOT_BIN $HUBOT_OPTION >> $HUBOT_LOG
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment