Update mm-scripts.sh
This commit is contained in:
@@ -102,7 +102,8 @@ MMSTART(){
|
|||||||
checked=""
|
checked=""
|
||||||
fi
|
fi
|
||||||
if [ "${checked}" == "false" ] && [ ${cc} -eq 10 ]; then
|
if [ "${checked}" == "false" ] && [ ${cc} -eq 10 ]; then
|
||||||
echo -e "${idsCL[Red]}Could not confirm default routes using the VPN only!${idsCL[Default]}"
|
echo -e "${idsCL[Red]}Could not confirm default routes, shutting down!${idsCL[Default]}"
|
||||||
|
echo "$(date) - Could not confirm default routes, shutting down" >> $logfile
|
||||||
MMSTOP
|
MMSTOP
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -111,6 +112,28 @@ MMSTART(){
|
|||||||
done
|
done
|
||||||
echo -e "${idsCL[Green]} done${idsCL[Default]}"
|
echo -e "${idsCL[Green]} done${idsCL[Default]}"
|
||||||
|
|
||||||
|
|
||||||
|
echo -en "${idsCL[LightCyan]}Verifing traffic is routing through VPN... ${idsCL[Default]}"
|
||||||
|
checked=false
|
||||||
|
cc=0
|
||||||
|
until [ "${checked}" = "" ]; do
|
||||||
|
scip=$(dig +short sc1.scity.us @ns1.scity.us)
|
||||||
|
mmip=$(dig +short myip.opendns.com @resolver1.opendns.com)
|
||||||
|
if [ "${scip}" != "${mmip}" ]; then
|
||||||
|
checked=""
|
||||||
|
fi
|
||||||
|
if [ "${checked}" == "false" ] && [ ${cc} -eq 10 ]; then
|
||||||
|
echo -e "${idsCL[Red]}Traffic is not routing through VPN!${idsCL[Default]}"
|
||||||
|
echo "$(date) - Traffic is not routing through VPN, shutting down" >> $logfile
|
||||||
|
MMSTOP
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
((cc=${cc}+1))
|
||||||
|
sleep 1s
|
||||||
|
done
|
||||||
|
echo -e "${idsCL[Green]} done${idsCL[Default]}"
|
||||||
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo -en "${idsCL[LightCyan]}${mmsv} Services... ${idsCL[Default]}"
|
echo -en "${idsCL[LightCyan]}${mmsv} Services... ${idsCL[Default]}"
|
||||||
for srvc in "${SERVICES_CHECK[@]}"; do
|
for srvc in "${SERVICES_CHECK[@]}"; do
|
||||||
@@ -133,13 +156,14 @@ MMSTART(){
|
|||||||
echo -e "${idsCL[Red]} failed${idsCL[Default]}"
|
echo -e "${idsCL[Red]} failed${idsCL[Default]}"
|
||||||
echo
|
echo
|
||||||
echo -e "${idsCL[Red]}Could not start the VPN, fix your shit...${idsCL[Default]}"
|
echo -e "${idsCL[Red]}Could not start the VPN, fix your shit...${idsCL[Default]}"
|
||||||
|
echo "$(date) - Could not start the VPN, fix your shit..." >> $logfile
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
MMSTOP(){
|
MMSTOP(){
|
||||||
if [ -f /opt/mm.stop ]; then
|
if [ -f /opt/mm.stop ]; then
|
||||||
echo -e "${idsCL[Yellow]}The system is already stopped, will verify anyway,..${idsCL[Default]}"
|
echo -e "${idsCL[Yellow]}The system is already stopped, will verify anyway...${idsCL[Default]}"
|
||||||
else
|
else
|
||||||
echo -e "${idsCL[Green]}Stopping System...${idsCL[Default]}"
|
echo -e "${idsCL[Green]}Stopping System...${idsCL[Default]}"
|
||||||
echo
|
echo
|
||||||
@@ -158,17 +182,17 @@ MMSTOP(){
|
|||||||
if ! lsof -Pi :5656 -sTCP:LISTEN -t >/dev/null; then #sonarr
|
if ! lsof -Pi :5656 -sTCP:LISTEN -t >/dev/null; then #sonarr
|
||||||
if ! lsof -Pi :5858 -sTCP:LISTEN -t >/dev/null; then #qbittorrent
|
if ! lsof -Pi :5858 -sTCP:LISTEN -t >/dev/null; then #qbittorrent
|
||||||
if ! lsof -Pi :8181 -sTCP:LISTEN -t >/dev/null; then #tautulli
|
if ! lsof -Pi :8181 -sTCP:LISTEN -t >/dev/null; then #tautulli
|
||||||
if ! lsof -Pi :8686 -sTCP:LISTEN -t >/dev/null; then #jackett
|
if ! lsof -Pi :8686 -sTCP:LISTEN -t >/dev/null; then #lidarr
|
||||||
if ! lsof -Pi :9117 -sTCP:LISTEN -t >/dev/null; then #jackett
|
if ! lsof -Pi :9117 -sTCP:LISTEN -t >/dev/null; then #jackett
|
||||||
checked=""
|
checked=""
|
||||||
fi
|
fi #/jackett
|
||||||
fi
|
fi #/lidarr
|
||||||
fi
|
fi #/tautulli
|
||||||
fi
|
fi #/qbittorrent
|
||||||
fi
|
fi #/sonarr
|
||||||
fi
|
fi #/radarr3d
|
||||||
fi
|
fi #/radarr
|
||||||
fi
|
fi #/ombi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo -e "${idsCL[Green]} done${idsCL[Default]}"
|
echo -e "${idsCL[Green]} done${idsCL[Default]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user