Update mm-scripts.sh
This commit is contained in:
@@ -323,9 +323,8 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf
|
|||||||
echo -en "${idsCL[LightCyan]}${msg}${spc} ${idsCL[White]}: ${idsCL[Default]}"
|
echo -en "${idsCL[LightCyan]}${msg}${spc} ${idsCL[White]}: ${idsCL[Default]}"
|
||||||
|
|
||||||
for srvc in "${SERVICES_CHECK[@]}"; do
|
for srvc in "${SERVICES_CHECK[@]}"; do
|
||||||
if [ "$(systemctl is-active ${srvc})" != "active" ]; then
|
[ "$(systemctl is-active ${srvc})" != "active" ] && /bin/systemctl start ${srvc}
|
||||||
/bin/systemctl start ${srvc}
|
|
||||||
fi
|
|
||||||
if [ "${MM_SERVICE_PORTS[${srvc}]}" != "" ]; then
|
if [ "${MM_SERVICE_PORTS[${srvc}]}" != "" ]; then
|
||||||
checkport=$(lsof -Pi :${MM_SERVICE_PORTS[${srvc}]} -sTCP:LISTEN -t)
|
checkport=$(lsof -Pi :${MM_SERVICE_PORTS[${srvc}]} -sTCP:LISTEN -t)
|
||||||
|
|
||||||
@@ -336,14 +335,15 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf
|
|||||||
if [ "${checkport}" != "" ]; then
|
if [ "${checkport}" != "" ]; then
|
||||||
checked=""
|
checked=""
|
||||||
fi
|
fi
|
||||||
if [ "${checked}" == "false" ] && [ ${cc} -eq 6 ]; then
|
if [ "${checked}" == "false" ] && [ ${cc} -eq 10 ]; then
|
||||||
echo -e "${idsCL[Red]}${srvc} Service is not starting properly, will try and update${idsCL[Default]}"
|
msg="${srvc^} Service is not starting properly, will try and update"
|
||||||
echo "$(date) - ${srvc} Service is not starting properly, will try and update" >> $logfile
|
echo -e "${idsCL[Red]}${msg}${idsCL[Default]}"
|
||||||
SENDNOTICE "${srvc} Service Issue" "${srvc} Service is not starting properly, will try and update" 1
|
echo "$(date) - ${msg}" >> $logfile
|
||||||
|
SENDNOTICE "${srvc^} Service Issue" "${msg}" 1
|
||||||
checked=""
|
checked=""
|
||||||
tryupdate="true"
|
tryupdate="true"
|
||||||
|
|
||||||
msg="Updating ${srvc} Service"
|
msg="Updating ${srvc^} Service"
|
||||||
c=0; spc=''; spc1=$((${cw_spc}-${#msg}))
|
c=0; spc=''; spc1=$((${cw_spc}-${#msg}))
|
||||||
until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
|
until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
|
||||||
echo -en "${idsCL[LightCyan]}${msg}${spc} ${idsCL[White]}: ${idsCL[Default]}"
|
echo -en "${idsCL[LightCyan]}${msg}${spc} ${idsCL[White]}: ${idsCL[Default]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user