From 4b9a05cfc6a61ed2ea9d512dd24c170ced6db8c8 Mon Sep 17 00:00:00 2001 From: PhilPhonic Date: Mon, 1 Feb 2016 22:54:45 +0100 Subject: [PATCH] command_monitor.sh restart server if there is no lockfile and feature is enabled --- functions/command_monitor.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/functions/command_monitor.sh b/functions/command_monitor.sh index f253abc54..467c97c36 100644 --- a/functions/command_monitor.sh +++ b/functions/command_monitor.sh @@ -60,12 +60,21 @@ fn_printdots "${servername}" fn_scriptlog "${servername}" sleep 1 if [ ! -f "${rootdir}/${lockselfname}" ]; then - fn_printinfo "Disabled: No lock file found" - fn_scriptlog "Disabled: No lock file found" - sleep 1 - echo -en "\n" - echo "To enable monitor run ./${selfname} start" - exit 1 + if [ ${startonmonitor} == "on" ]; then + fn_printinfo "No lock file found" + fn_scriptlog "No lock file found" + sleep 1 + echo -en "\n" + fn_scriptlog "Monitor is starting ${servername}" + command_start.sh + else + fn_printinfo "Disabled: No lock file found" + fn_scriptlog "Disabled: No lock file found" + sleep 1 + echo -en "\n" + echo "To enable monitor run ./${selfname} start" + exit 1 + fi fi updatecheck=$(ps -ef|grep "${selfname} update"|grep -v grep|wc -l)