Script daemon-example.sh

From campisano.org
Jump to navigation Jump to search
#!/bin/bash
#

# base functions import
. /srv/config/functions.sh;



### variables

TITLE="<DAEMON SERVICE DESCRIPTION>";
ACTION="${1}";



DAEMON[1]="<IF THE EXECUTABLE KEEP RUNNING: true/false >";
OWN[1]="<RUNNING USER>";
PROG[1]="<EXECUTABLE PATH>";
NAME[1]=`base_name "${PROG[1]}"`;
FILE[1]="${CONF_PATH}/<FILE PATH TO TEST>";
DIR[1]="${CONF_PATH}/<DIR PATH TO TEST>";
START_OPT[1]="${PROG[1]} <EXECUTABLE OPTION ex -c ${FILE[1]}>";
STOP_OPT[1]="<STOP COMMAND ex killall ${NAME[1]}>";



### start/stop daemon

daemon_main;



# End