diff --git a/defaults.inc b/defaults.inc index 6957814..ecf9e0b 100755 --- a/defaults.inc +++ b/defaults.inc @@ -2,6 +2,7 @@ VERS='1.01232022' +MMSRV=$(/sbin/ip -o -4 addr list ens160 | awk '{print $4}' | cut -d/ -f1) declare -A NM_SERVICES NM_SERVICES['nordvpn']='NordVPN (NordVPN VPN Tunnel)' diff --git a/mm-scripts.sh b/mm-scripts.sh index 1c5b30c..b4a2557 100755 --- a/mm-scripts.sh +++ b/mm-scripts.sh @@ -9,7 +9,6 @@ source /opt/idssys/defaults/default.inc source /opt/idssys/settings/mediamanager.conf source /opt/idssys/mediamanager/defaults.inc - if [ "${action}" != "check" ] && [ "${action}" != "update" ]; then echo "" echo -e "${idsCL[LightGreen]} MediaManager ${idsCL[Default]} ${idsCL[DarkGray]}(ver-${VERS})${idsCL[Default]}" @@ -119,7 +118,7 @@ MMSTOP(){ } MMSTATUS(){ - if [[ $(/sbin/ip -o -4 addr list ens160 | awk '{print $4}' | cut -d/ -f1) == *"10.10.1.24"* ]]; then + if [[ ${MMSRV} == *"10.10.1.24"* ]]; then statusArray=("nordvpn") else statusArray=("openvpn") @@ -132,9 +131,11 @@ MMSTATUS(){ echo -en " ${NM_SERVICES[${srvc}]}$spc: " if [ "$(systemctl is-active ${srvc})" != "active" ]; then - echo -e "${idsCL[Red]}Not Running${idsCL[Default]}" - else - echo -e "${idsCL[Green]}Running${idsCL[Default]}" + if [ "$(systemctl is-active ${srvc})" != "active" ]; then + echo -e "${idsCL[Red]}Not Running${idsCL[Default]}" + else + echo -e "${idsCL[Green]}Running${idsCL[Default]}" + fi fi done