Update mm-scripts.sh
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
action="$1"
|
action="$1"
|
||||||
|
|
||||||
VERBOSE=true
|
VERBOSE=true
|
||||||
|
SENDNOTICE=true
|
||||||
|
|
||||||
|
|
||||||
source /opt/idssys/defaults/colors.inc
|
source /opt/idssys/defaults/colors.inc
|
||||||
@@ -45,6 +46,7 @@ MMSTART(){
|
|||||||
if [ -f /opt/mm.vpn.fail ]; then
|
if [ -f /opt/mm.vpn.fail ]; then
|
||||||
echo -e "${idsCL[Red]} failed, restarting system${idsCL[Default]}"
|
echo -e "${idsCL[Red]} failed, restarting system${idsCL[Default]}"
|
||||||
echo "$(date) - VPN Failure #2 - restarting system" >> $logfile
|
echo "$(date) - VPN Failure #2 - restarting system" >> $logfile
|
||||||
|
[ $SENDNOTICE = true ] && echo "2nd Failure, will try and restart the VPN" | mail -s "VPN Failure" 9208839613@mms.att.net
|
||||||
touch /opt/mm.vpn.fail2
|
touch /opt/mm.vpn.fail2
|
||||||
rm -f /opt/mm.vpn.fail
|
rm -f /opt/mm.vpn.fail
|
||||||
MMSTOP
|
MMSTOP
|
||||||
@@ -55,11 +57,13 @@ MMSTART(){
|
|||||||
exit 1
|
exit 1
|
||||||
elif [ -f /opt/mm.vpn.fail2 ]; then
|
elif [ -f /opt/mm.vpn.fail2 ]; then
|
||||||
echo "$(date) - VPN Failure #3 - Shutting down Media Management systems" >> $logfile
|
echo "$(date) - VPN Failure #3 - Shutting down Media Management systems" >> $logfile
|
||||||
|
[ $SENDNOTICE = true ] && echo "Final Failure, shutting down system" | mail -s "VPN Failure" 9208839613@mms.att.net
|
||||||
MMSTOP
|
MMSTOP
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo -e "${idsCL[Red]} failed, restarting system${idsCL[Default]}"
|
echo -e "${idsCL[Red]} failed, restarting system${idsCL[Default]}"
|
||||||
echo "$(date) - VPN Failure #1 - restarting system" >> $logfile
|
echo "$(date) - VPN Failure #1 - restarting system" >> $logfile
|
||||||
|
[ $SENDNOTICE = true ] && echo "1st Failure, will try and restart the VPN" | mail -s "VPN Failure" 9208839613@mms.att.net
|
||||||
touch /opt/mm.vpn.fail
|
touch /opt/mm.vpn.fail
|
||||||
MMSTOP
|
MMSTOP
|
||||||
sleep 1m
|
sleep 1m
|
||||||
@@ -91,6 +95,7 @@ MMSTART(){
|
|||||||
if [ "${checked}" == "false" ] && [ ${cc} -eq 10 ]; then
|
if [ "${checked}" == "false" ] && [ ${cc} -eq 10 ]; then
|
||||||
echo -e "${idsCL[Red]}Could not confirm default routes, restarting system!${idsCL[Default]}"
|
echo -e "${idsCL[Red]}Could not confirm default routes, restarting system!${idsCL[Default]}"
|
||||||
echo "$(date) - Could not confirm default routes, restarting system" >> $logfile
|
echo "$(date) - Could not confirm default routes, restarting system" >> $logfile
|
||||||
|
[ $SENDNOTICE = true ] && echo "Default route failure, will try and restart the VPN" | mail -s "Network Failure" 9208839613@mms.att.net
|
||||||
MMSTOP
|
MMSTOP
|
||||||
sleep 1m
|
sleep 1m
|
||||||
"${VPN_START[@]}"
|
"${VPN_START[@]}"
|
||||||
@@ -113,6 +118,7 @@ MMSTART(){
|
|||||||
echo -e "${idsCL[Red]}Traffic is not routing through VPN, restarting system!${idsCL[Default]}"
|
echo -e "${idsCL[Red]}Traffic is not routing through VPN, restarting system!${idsCL[Default]}"
|
||||||
echo "$(date) - Traffic is not routing through VPN, restarting system scip(${scip}) mmip(${mmip})" >> $logfile
|
echo "$(date) - Traffic is not routing through VPN, restarting system scip(${scip}) mmip(${mmip})" >> $logfile
|
||||||
[ $VERBOSE = true ] && echo "$(date) - Default Routes: zerogw(${zerogw}) defaultgw(${defaultgw})" >> $logfile
|
[ $VERBOSE = true ] && echo "$(date) - Default Routes: zerogw(${zerogw}) defaultgw(${defaultgw})" >> $logfile
|
||||||
|
[ $SENDNOTICE = true ] && echo "Traffic route failure, will try and restart the VPN" | mail -s "Network Failure" 9208839613@mms.att.net
|
||||||
MMSTOP
|
MMSTOP
|
||||||
sleep 1m
|
sleep 1m
|
||||||
"${VPN_START[@]}"
|
"${VPN_START[@]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user