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

9
lgsm/functions/command_monitor.sh

@ -37,15 +37,6 @@ fn_monitor_msg_checking(){
sleep 1 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(){ fn_monitor_teamspeak3(){
if [ "${status}" != "0" ]; then if [ "${status}" != "0" ]; then
fn_print_ok "Checking session: " fn_print_ok "Checking session: "

7
lgsm/functions/monitor_gsquery.sh

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

6
lgsm/functions/update_check.sh

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

Loading…
Cancel
Save