This commit is contained in:
2024-09-30 17:24:30 -05:00
parent 66792501d5
commit 6364965acf
2 changed files with 22 additions and 21 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
VERS='3.9.80-09302024' VERS='3.9.85-09302024'
MMFOLDER="/opt/idssys/mediamanager" MMFOLDER="/opt/idssys/mediamanager"
TMPFOLDER="${MMFOLDER}/.tmp" TMPFOLDER="${MMFOLDER}/.tmp"

View File

@@ -192,7 +192,7 @@ MMSTART(){
echo "$(date) - Your '${sessiontimeout}' session limit reached, restarting vpn & services" >> ${MM_LOGFILE} echo "$(date) - Your '${sessiontimeout}' session limit reached, restarting vpn & services" >> ${MM_LOGFILE}
echo -en "${idsCL[LightCyan]}Your '${idsCL[White]}${sessiontimeout}${idsCL[LightCyan]}' session limit reached, restarting vpn & services${idsCL[Default]}" echo -en "${idsCL[LightCyan]}Your '${idsCL[White]}${sessiontimeout}${idsCL[LightCyan]}' session limit reached, restarting vpn & services${idsCL[Default]}"
fi fi
[ -f ${TMPFOLDER}/mm.noservices ] && rv="vpn" || rv="" ([ -f ${TMPFOLDER}/mm.noservices ] || [ -f ${MMFOLDER}/mm.noservices ]) && rv="vpn" || rv=""
MMSTOP >/dev/null 2>&1 MMSTOP >/dev/null 2>&1
echo -en "." echo -en "."
read -et 10 read -et 10
@@ -669,6 +669,7 @@ MMSTATUS(){
if ([ ! -f ${TMPFOLDER}/mm.stop* ] && [ "${1}" == "fix" ]) || ([ ! -f ${TMPFOLDER}/mm.stop ] && [ -f ${TMPFOLDER}/mm.stop.checking ] && [ "${1}" == "fix" ]); then if ([ ! -f ${TMPFOLDER}/mm.stop* ] && [ "${1}" == "fix" ]) || ([ ! -f ${TMPFOLDER}/mm.stop ] && [ -f ${TMPFOLDER}/mm.stop.checking ] && [ "${1}" == "fix" ]); then
echo echo
echo -e "${idsCL[LightCyan]}Restarting system...${idsCL[Default]}" echo -e "${idsCL[LightCyan]}Restarting system...${idsCL[Default]}"
([ -f ${TMPFOLDER}/mm.noservices ] || [ -f ${MMFOLDER}/mm.noservices ]) && rv="vpn" || rv=""
MMSTOP MMSTOP
echo -en "${idsCL[LightCyan]}Pausing for 10secs... ${idsCL[Default]}" echo -en "${idsCL[LightCyan]}Pausing for 10secs... ${idsCL[Default]}"
sleep 10s sleep 10s
@@ -676,7 +677,7 @@ MMSTATUS(){
echo echo
echo -e "${idsCL[LightCyan]}Starting system back up...${idsCL[Default]}" echo -e "${idsCL[LightCyan]}Starting system back up...${idsCL[Default]}"
echo echo
MMSTART MMSTART start ${rv}
msg=" ${MM_SERVICES[wireguard]}" msg=" ${MM_SERVICES[wireguard]}"
c=0; spc=''; spc1=$((${cw_spc}-${#msg})) c=0; spc=''; spc1=$((${cw_spc}-${#msg}))
@@ -733,6 +734,7 @@ MMSTATUS(){
if ([ ! -f ${TMPFOLDER}/mm.stop* ] && [ "${1}" == "fix" ]) || ([ ! -f ${TMPFOLDER}/mm.stop ] && [ -f ${TMPFOLDER}/mm.stop.checking ] && [ "${1}" == "fix" ]); then if ([ ! -f ${TMPFOLDER}/mm.stop* ] && [ "${1}" == "fix" ]) || ([ ! -f ${TMPFOLDER}/mm.stop ] && [ -f ${TMPFOLDER}/mm.stop.checking ] && [ "${1}" == "fix" ]); then
echo echo
echo -e "${idsCL[LightCyan]}Restarting system...${idsCL[Default]}" echo -e "${idsCL[LightCyan]}Restarting system...${idsCL[Default]}"
([ -f ${TMPFOLDER}/mm.noservices ] || [ -f ${MMFOLDER}/mm.noservices ]) && rv="vpn" || rv=""
MMSTOP MMSTOP
echo -en "${idsCL[LightCyan]}Pausing for 10secs... ${idsCL[Default]}" echo -en "${idsCL[LightCyan]}Pausing for 10secs... ${idsCL[Default]}"
sleep 10s sleep 10s
@@ -740,7 +742,7 @@ MMSTATUS(){
echo echo
echo -e "${idsCL[LightCyan]}Starting system back up...${idsCL[Default]}" echo -e "${idsCL[LightCyan]}Starting system back up...${idsCL[Default]}"
echo echo
MMSTART start MMSTART start ${rv}
fi fi
fi fi
@@ -845,15 +847,15 @@ VPNSPEEDTEST(){
echo -e "${idsCL[Green]}VPN Speedtest Comparison${idsCL[Default]}" echo -e "${idsCL[Green]}VPN Speedtest Comparison${idsCL[Default]}"
DIVIDER . lightGreen DIVIDER . lightGreen
echo echo
if [ ! -f ${TMPFOLDER}/mm.stop ] && [ "${SERVICESCHECK}" != "" ]; then if [ ! -f ${TMPFOLDER}/mm.stop ]; then
echo -en "${idsCL[LightCyan]}This requires all media management services to be stopped, ok (Y/n)? ${idsCL[Default]}" echo -en "${idsCL[LightCyan]}This requires all MM/VPN services to be stopped, ok (Y/n)? ${idsCL[Default]}"
read -n 1 choice read -n 1 choice
case "$choice" in case "$choice" in
[Nn]) exit 0;; esac [Nn]) exit 0;; esac
echo echo
echo -en "${idsCL[LightCyan]}Stopping media management services ... ${idsCL[Default]}" echo -en "${idsCL[LightCyan]}Stopping MM/VPN Services ... ${idsCL[Default]}"
else else
echo -en "${idsCL[LightCyan]}Verifying media management services are stopped ... ${idsCL[Default]}" echo -en "${idsCL[LightCyan]}Verifying MM/VPN Services are stopped ... ${idsCL[Default]}"
fi fi
MMSTOP >/dev/null 2>&1 MMSTOP >/dev/null 2>&1
echo -e "${idsCL[Green]}Done${idsCL[Default]}" echo -e "${idsCL[Green]}Done${idsCL[Default]}"
@@ -882,19 +884,18 @@ VPNSPEEDTEST(){
echo -en "${idsCL[LightCyan]}Stopping vpn ... ${idsCL[Default]}" echo -en "${idsCL[LightCyan]}Stopping vpn ... ${idsCL[Default]}"
# "${VPN_STOP[@]}" >/dev/null 2>&1 # "${VPN_STOP[@]}" >/dev/null 2>&1
([ -f ${TMPFOLDER}/mm.noservices ] || [ -f ${MMFOLDER}/mm.noservices ]) && rv="vpn" || rv=""
MMSTOP >/dev/null 2>&1 MMSTOP >/dev/null 2>&1
echo -e "${idsCL[Green]}Done${idsCL[Default]}" echo -e "${idsCL[Green]}Done${idsCL[Default]}"
if [ "${SERVICESCHECK}" != "" ]; then echo
echo echo -en "${idsCL[LightCyan]}Would you like to start MM/VPN services (y/N)? ${idsCL[Default]}"
echo -en "${idsCL[LightCyan]}Would you like to start media management services (y/N)? ${idsCL[Default]}" read -n 1 choice
read -n 1 choice echo
echo case "$choice" in
case "$choice" in [Yy]) MMSTART start ${rv};;
[Yy]) MMSTART start;; * ) echo -e "${idsCL[Cyan]}Not starting. To start, run the command '${idsCL[Green]}mm start${idsCL[LightCyan]}'${idsCL[Default]}";echo;echo;;
* ) echo -e "${idsCL[Cyan]}Not starting. To start, run the command '${idsCL[Green]}mm start${idsCL[LightCyan]}'${idsCL[Default]}";echo;echo;; esac
esac
fi
} }
UPDATESERVICE(){ UPDATESERVICE(){
@@ -1424,7 +1425,7 @@ MMSETUP(){
# echo # echo
# srvcs2=${SERVICESCHECK/snap.tautulli.tautulli/tautulli} # srvcs2=${SERVICESCHECK/snap.tautulli.tautulli/tautulli}
# srvcs2=${srvcs2/snap.overseerr.daemon/overseerr} # srvcs2=${srvcs2/snap.overseerr.daemon/overseerr}
# echo -e "${idsCL[LightCyan]}Run previous media management services${idsCL[Default]}" # echo -e "${idsCL[LightCyan]}Run previous MM/VPN Services${idsCL[Default]}"
# echo -en "${idsCL[LightYellow]}['${idsCL[White]}${srvcs2}${idsCL[LightYellow]}']${idsCL[LightCyan]} (Y/n)? ${idsCL[Default]}" # echo -en "${idsCL[LightYellow]}['${idsCL[White]}${srvcs2}${idsCL[LightYellow]}']${idsCL[LightCyan]} (Y/n)? ${idsCL[Default]}"
# read -n 1 choice # read -n 1 choice
# case "$choice" in # case "$choice" in
@@ -1635,7 +1636,7 @@ MMSETUP(){
esac esac
else else
echo echo
echo -en "${idsCL[LightCyan]}Would you like to update media management services (y/N)? ${idsCL[Default]}" echo -en "${idsCL[LightCyan]}Would you like to update MM/VPN Services (y/N)? ${idsCL[Default]}"
read -n 1 choice read -n 1 choice
case "$choice" in case "$choice" in
[Yy]) for usrvc in "${UPDATE_SERVICES[@]}"; do [Yy]) for usrvc in "${UPDATE_SERVICES[@]}"; do
@@ -1644,7 +1645,7 @@ MMSETUP(){
* ) tmp='';; * ) tmp='';;
esac esac
echo echo
echo -en "${idsCL[LightCyan]}Would you like to start media management services (y/N)? ${idsCL[Default]}" echo -en "${idsCL[LightCyan]}Would you like to start MM/VPN Services (y/N)? ${idsCL[Default]}"
read -n 1 choice read -n 1 choice
echo echo
case "$choice" in case "$choice" in