update
This commit is contained in:
@@ -54,5 +54,5 @@ MMUPDATECHECK(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
SENDNOTICE(){
|
SENDNOTICE(){
|
||||||
[ "${EMAIL_NOTICE}" != "" ] && echo "${2}" | mail -s "${1}" ${EMAIL_NOTICE}
|
[ "${EMAIL_NOTICE}" != "" ] && echo -e "${2}\n\n$(date)" | mail -s "${1}" ${EMAIL_NOTICE}
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ MMSTART(){
|
|||||||
|
|
||||||
elif [ "${1}" = "check" ] && [ "$(ip link | grep "wg-torguard")" = "" ] && [ ! -f ${MMFOLDER}/mm.vpn* ]; then
|
elif [ "${1}" = "check" ] && [ "$(ip link | grep "wg-torguard")" = "" ] && [ ! -f ${MMFOLDER}/mm.vpn* ]; then
|
||||||
GOFORSTART=true;
|
GOFORSTART=true;
|
||||||
SENDNOTICE "Starting Media Management Systems" "$(date)"
|
SENDNOTICE "Starting Media Management Systems" ""
|
||||||
echo "$(date) - Starting Media Management system - (fresh start)" >> $logfile
|
echo "$(date) - Starting Media Management system - (fresh start)" >> $logfile
|
||||||
echo -e "${idsCL[LightCyan]}Fresh startup${idsCL[Default]}"
|
echo -e "${idsCL[LightCyan]}Fresh startup${idsCL[Default]}"
|
||||||
|
|
||||||
@@ -122,14 +122,14 @@ PersistentKeepalive = 25" >> /etc/wireguard/wg-torguard.conf
|
|||||||
exit 1
|
exit 1
|
||||||
elif [ -f ${MMFOLDER}/mm.vpn.fail2 ]; then
|
elif [ -f ${MMFOLDER}/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
|
||||||
[ "${EMAIL_NOTICE}" != "" ] && echo SENDNOTICE "VPN Failure" "Final Failure, shutting down system"
|
SENDNOTICE "VPN Failure" "Final Failure, shutting down system"
|
||||||
MMSTOP
|
MMSTOP
|
||||||
[ $VERBOSE = true ] && DEBUGLOGSTOP
|
[ $VERBOSE = true ] && DEBUGLOGSTOP
|
||||||
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
|
||||||
[ "${EMAIL_NOTICE}" != "" ] && echo SENDNOTICE "VPN Failure" "1st Failure, will try and restart the VPN"
|
SENDNOTICE "VPN Failure" "1st Failure, will try and restart the VPN"
|
||||||
touch ${MMFOLDER}/mm.vpn.fail
|
touch ${MMFOLDER}/mm.vpn.fail
|
||||||
MMSTOP
|
MMSTOP
|
||||||
sleep 30s
|
sleep 30s
|
||||||
|
|||||||
Reference in New Issue
Block a user