<commit_before># Your service name
SERVICE_NAME=
# Your daemon base directory
SERVICE_DIRECTORY=/opt/Portal/bin
# Your main Jar
MAIN_JAR=MyDaemon.jar
# Your Java home
DAEMON_JAVA_HOME=%JAVA_HOME%
# Associated pid file
PID_FILE=/var/run/${SERVICE_NAME}.pid
 
usage()
{
        echo "-----------------------"
        echo "Usage: $0 (shutdown|start|pause|resume|restart)"
        echo "-----------------------"
}
 
if [ -z $1 ]; then
        usage
fi
 
service_start()
{
        echo "Starting service '${SERVICE_NAME}'..."
        OWD=`pwd`
        cd ${SERVICE_DIRECTORY}
	deimos -cp ${DAEMON_JAVA_HOME} -pidfile ${PID_FILE} ${MAIN_JAR}
        cd $OWD
        echo "Service '${SERVICE_NAME}' started successfully"
}

service_pause()
{
        echo "Pause service '${SERVICE_NAME}'..."
        OWD=`pwd`
        cd ${SERVICE_DIRECTORY}
	deimos -cp ${DAEMON_JAVA_HOME} -pause -pidfile ${PID_FILE}
        cd $OWD
        echo "Service '${SERVICE_NAME}' paused"
}

service_resume()
{
        echo "Resume service '${SERVICE_NAME}'..."
        OWD=`pwd`
        cd ${SERVICE_DIRECTORY}
	deimos -cp ${DAEMON_JAVA_HOME} -resume -pidfile ${PID_FILE}
        cd $OWD
        echo "Service '${SERVICE_NAME}' resumed"
}
 
service_shutdown()
{
        echo "Stopping service '${SERVICE_NAME}'..."
        OWD=`pwd`
        cd ${SERVICE_DIRECTORY}
	deimos -cp ${DAEMON_JAVA_HOME} -stop -pidfile ${PID_FILE}
        cd $OWD
        echo "Service '${SERVICE_NAME}' stopped"
}
 
case $1 in
        shutdown)
                service_shutdown
        ;;
        start)
                service_start
        ;;
        pause)
                service_pause
        ;;
        resume)
                service_resume
        ;;
        restart)
                service_stop
                service_start
        ;;
        *)
                usage<commit_msg>Implementing switch to stat/pause/resume/shutdown background process<commit_after># Your service name
SERVICE_NAME=
# Your daemon base directory
SERVICE_DIRECTORY=/opt/Portal/bin
# Your main Jar
MAIN_JAR=MyDaemon.jar
# Your Java home
DAEMON_JAVA_HOME=%JAVA_HOME%
# Associated pid file
PID_FILE=/var/run/${SERVICE_NAME}.pid
 
usage()
{
        echo "-----------------------"
        echo "Usage: $0 (shutdown|start|pause|resume|restart)"
        echo "-----------------------"
}
 
if [ -z $1 ]; then
        usage
fi
 
service_start()
{
        echo "Starting service '${SERVICE_NAME}'..."
        OWD=`pwd`
        cd ${SERVICE_DIRECTORY}
	deimos -cp ${DAEMON_JAVA_HOME} -pidfile ${PID_FILE} ${MAIN_JAR}
        cd $OWD
        echo "Service '${SERVICE_NAME}' started successfully"
}

service_pause()
{
        echo "Pause service '${SERVICE_NAME}'..."
        OWD=`pwd`
        cd ${SERVICE_DIRECTORY}
	deimos -cp ${DAEMON_JAVA_HOME} -pause -pidfile ${PID_FILE}
        cd $OWD
        echo "Service '${SERVICE_NAME}' paused"
}

service_resume()
{
        echo "Resume service '${SERVICE_NAME}'..."
        OWD=`pwd`
        cd ${SERVICE_DIRECTORY}
	deimos -cp ${DAEMON_JAVA_HOME} -resume -pidfile ${PID_FILE}
        cd $OWD
        echo "Service '${SERVICE_NAME}' resumed"
}
 
service_shutdown()
{
        echo "Stopping service '${SERVICE_NAME}'..."
        OWD=`pwd`
        cd ${SERVICE_DIRECTORY}
	deimos -cp ${DAEMON_JAVA_HOME} -shutdown -pidfile ${PID_FILE}
        cd $OWD
        echo "Service '${SERVICE_NAME}' stopped"
}
 
case $1 in
        shutdown)
                service_shutdown
        ;;
        start)
                service_start
        ;;
        pause)
                service_pause
        ;;
        resume)
                service_resume
        ;;
        restart)
                service_stop
                service_start
        ;;
        *)
                usage
{'fraction_non_alphanumeric': 0.14155739898314157, 'fraction_numerical': 0.0016055659620016055, 'mean_word_length': 1.899922420480993, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3916008', 'n_tokens_mistral': 1235, 'n_tokens_neox': 1206, 'n_words': 266}