<commit_before>#! /bin/sh

### BEGIN INIT INFO
# Provides:          gbot
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: gbot initscript
# Description:       This file should be named to 'gbot' placed in /etc/init.d.
### END INIT INFO

export GBOT_ROOT_DIR="/home/gbot/gbot"

usage="Usage: /etc/init.d/servod start|stop|restart"
initfile="/etc/init.d/gbot"
exit_success=0
exit_usage=1

gbot_logfile="/tmp/gbot_log.txt"

log()
{
    echo ${gbot_logfile}": $1" >> ${gbot_logfile} 2>&1
}

start()
{
    log "starting..."
    ${GBOT_ROOT_DIR}/bin/gbotd.sh >> ${gbot_logfile} 2>&1 &
}

stop()
{
    log "stopping..."
    killall gbotd.sh >> ${gbot_logfile} 2>&1
    killall gunicorn >> ${gbot_logfile} 2>&1
}

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        log "restarting.."
        stop
        start
        ;;
    *)
        echo ${usage}
        exit 1
        ;;
esac

exit ${exit_success}<commit_msg>init script fixes<commit_after>#! /bin/sh

### BEGIN INIT INFO
# Provides:          gbot
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: gbot initscript
# Description:       This file should be named to 'gbot' placed in /etc/init.d.
### END INIT INFO

export GBOT_ROOT_DIR="/home/gbot/gbot"

usage="Usage: /etc/init.d/servod start|stop|restart"
initfile="/etc/init.d/gbot"
exit_success=0
exit_usage=1

gbot_logfile="/tmp/gbot_log.txt"

log()
{
    echo "${gbot_logfile}: $1" >> ${gbot_logfile} 2>&1
}

start()
{
    log "starting..."
    ${GBOT_ROOT_DIR}/bin/gbotd.sh >> ${gbot_logfile} 2>&1 &
}

stop()
{
    log "stopping..."
    killall gbotd.sh >> ${gbot_logfile} 2>&1
    killall gunicorn >> ${gbot_logfile} 2>&1
}

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        log "restarting.."
        stop
        start
        ;;
    *)
        echo ${usage}
        exit 1
        ;;
esac

exit ${exit_success}
{'fraction_non_alphanumeric': 0.15327102803738318, 'fraction_numerical': 0.018691588785046728, 'mean_word_length': 2.3400936037441498, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6047679', 'n_tokens_mistral': 845, 'n_tokens_neox': 812, 'n_words': 181}