Browse Source

Update alert

pull/821/head
Daniel Gibbs 9 years ago
parent
commit
f0872c9ea6
  1. 8
      lgsm/functions/alert.sh
  2. 9
      lgsm/functions/command_monitor.sh
  3. 7
      lgsm/functions/monitor_gsquery.sh
  4. 6
      lgsm/functions/update_check.sh

8
lgsm/functions/alert.sh

@ -18,7 +18,7 @@ fn_alert_restart(){
alertbody="${servicename} ${executable} process not running"
}
fn_alert_queryrestart(){
fn_alert_restart_query(){
fn_scriptlog "Sending restart alert: ${gsquerycmd}"
alertsubject="LGSM - Restarted - ${servername}"
alertbody="Failed to Query: ${gsquerycmd}"
@ -27,13 +27,13 @@ fn_alert_queryrestart(){
fn_alert_update(){
fn_scriptlog "Sending update alert"
alertsubject="LGSM - Updated - ${servername}"
alertbody="Recieved update: 154789"
alertbody="${servicename} Recieved update"
}
if [ "${alert}" == "restart" ]; then
fn_alert_restart
elif [ "${alert}" == "queryrestart" ]; then
fn_alert_queryrestart
elif [ "${alert}" == "restartquery" ]; then
fn_alert_restart_query
elif [ "${alert}" == "update" ]; then
fn_alert_update
elif [ "${alert}" == "test" ]; then

9
lgsm/functions/command_monitor.sh

@ -37,15 +37,6 @@ fn_monitor_msg_checking(){
sleep 1
}
fn_monitor_email_alert(){
# Email will be sent if enabled
if [ "${emailalert}" = "on" ]; then
alertsubject="LGSM - Restarted - ${servername}"
alertbody="${servicename} process not running"
alert.sh
fi
}
fn_monitor_teamspeak3(){
if [ "${status}" != "0" ]; then
fn_print_ok "Checking session: "

7
lgsm/functions/monitor_gsquery.sh

@ -69,11 +69,8 @@ if [ "${gsquery}" == "yes" ]; then
sleep 1
# Send alert if enabled
if [ "${emailalert}" == "on" ]; then
alert="queryrestart"
alert.sh
fi
alert="restartquery"
alert.sh
fn_restart
break
fi

6
lgsm/functions/update_check.sh

@ -98,6 +98,8 @@ fn_logupdaterequest(){
else
update_dl.sh
fi
alert="update"
alert.sh
else
fn_print_ok "Checking for update: Server logs: No update requested"
sleep 1
@ -175,6 +177,8 @@ fn_steamcmdcheck(){
else
update_dl.sh
fi
alert="update"
alert.sh
else
echo -e "\n"
echo -e "No update available:"
@ -304,6 +308,8 @@ fn_teamspeak3_check(){
update_dl.sh
command_start.sh
fi
alert="update"
alert.sh
else
echo -e "\n"
echo -e "No update available:"

Loading…
Cancel
Save