Update mm-scripts.sh
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
action="$1"
|
||||
|
||||
VERBOSE=false
|
||||
VERBOSE=true
|
||||
SENDNOTICE=true
|
||||
|
||||
|
||||
@@ -55,11 +55,13 @@ MMSTART(){
|
||||
"${VPN_START[@]}" &
|
||||
sleep 30s
|
||||
rm -f /opt/mm.stop
|
||||
[ $VERBOSE = true ] && debuglogstop();
|
||||
exit 1
|
||||
elif [ -f /opt/mm.vpn.fail2 ]; then
|
||||
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
|
||||
[ $VERBOSE = true ] && debuglogstop();
|
||||
exit 1
|
||||
else
|
||||
echo -e "${idsCL[Red]} failed, restarting system${idsCL[Default]}"
|
||||
@@ -71,6 +73,7 @@ MMSTART(){
|
||||
"${VPN_START[@]}" &
|
||||
sleep 30s
|
||||
rm -f /opt/mm.stop
|
||||
[ $VERBOSE = true ] && debuglogstop();
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -103,6 +106,7 @@ MMSTART(){
|
||||
"${VPN_START[@]}" &
|
||||
sleep 1m
|
||||
rm -f /opt/mm.stop
|
||||
[ $VERBOSE = true ] && debuglogstop();
|
||||
exit 1
|
||||
fi
|
||||
((cc=${cc}+1))
|
||||
@@ -130,6 +134,7 @@ MMSTART(){
|
||||
"${VPN_START[@]}" &
|
||||
sleep 1m
|
||||
rm -f /opt/mm.stop
|
||||
[ $VERBOSE = true ] && debuglogstop();
|
||||
exit 1
|
||||
fi
|
||||
((cc=${cc}+1))
|
||||
@@ -149,6 +154,7 @@ MMSTART(){
|
||||
"${VPN_START[@]}" &
|
||||
sleep 1m
|
||||
rm -f /opt/mm.stop
|
||||
[ $VERBOSE = true ] && debuglogstop();
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -171,17 +177,13 @@ MMSTART(){
|
||||
echo
|
||||
echo -e "${idsCL[Green]}All services have been started${idsCL[Default]}"
|
||||
if [ "${1}" = "start" ] || [ "${1}" = "" ]; then
|
||||
[ $VERBOSE = true ] && echo "$(date) - All services started" >> $logfile
|
||||
echo "$(date) - Media Management systems started" >> $logfile
|
||||
fi
|
||||
|
||||
fi
|
||||
echo
|
||||
|
||||
if [ $VERBOSE = true ]; then
|
||||
chktmend=`date +%s`
|
||||
chktm=$((chktmend-chktmstart))
|
||||
echo "$(date) - ${mmsv} Runtime: ${chktm}s" >> $logfile
|
||||
fi
|
||||
[ $VERBOSE = true ] && debuglogstop();
|
||||
|
||||
#exit 0
|
||||
}
|
||||
@@ -373,6 +375,12 @@ else
|
||||
echo
|
||||
fi
|
||||
|
||||
debuglogstop(){}
|
||||
chktmend=`date +%s`
|
||||
chktm=$((chktmend-chktmstart))
|
||||
echo "$(date) - ${mmsv} Runtime: ${chktm}s" >> $logfile
|
||||
}
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user