Update mm-scripts.sh

This commit is contained in:
2023-04-22 17:38:50 -05:00
parent 708559fcf8
commit 475024de15

View File

@@ -331,7 +331,8 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf
fi
if [ -f ${MMFOLDER}/mm.plexmount.fail ] && [ "${1}" == "start" ] && [ "${2}" != "vpn" ]; then
read -n 1 -p "Would you like to start services without Plex Media being mounted? (y/N): " choice
echo -en "${idsCL[LightCyan]}Would you like to start services without Plex Media being mounted? (y/N)? ${idsCL[Default]}"
read -n 1 choice
case "$choice" in
[Yy])
rm -f ${MMFOLDER}/mm.plexmount.fail*
@@ -697,7 +698,8 @@ GETVPNINFO(){
VPNSPEEDTEST(){
echo -e "${idsCL[Green]}VPN Speedtest Comparison${idsCL[Default]}"
echo
read -n 1 -p "This requires all media management services to be stopped, ok (Y/n)?" choice
echo -en "${idsCL[LightCyan]}This requires all media management services to be stopped, ok (Y/n)? ${idsCL[Default]}"
read -n 1 choice
case "$choice" in
[Nn]) exit 0;;
esac
@@ -725,7 +727,8 @@ VPNSPEEDTEST(){
MMSTOP >/dev/null 2>&1
echo
read -n 1 -p "Would you like to start media management services (y/N)?" choice
echo -en "${idsCL[LightCyan]}Would you like to start media management services (y/N)? ${idsCL[Default]}"
read -n 1 choice
echo
case "$choice" in
[Yy]) MMSTART start;;
@@ -903,33 +906,33 @@ MMSETUP(){
case "$choice" in
[Yy])
echo
echo -en "${idsCL[LightCyan]}Hostname [Default='`hostname`']: ${idsCL[Default]}"
echo -en "${idsCL[LightCyan]}Hostname [Default='${idsCL[White]}Media-Manager${idsCL[LightCyan]}']: ${idsCL[Default]}"
read -e HOSTNAME
[ "${HOSTNAME}" == "" ] && HOSTNAME=`hostname`
[ "${HOSTNAME}" == "" ] && HOSTNAME="Media-Manager"
echo
REPIP=`hostname -I`
REPIP=${REPIP/ /}
echo -en "${idsCL[LightCyan]}IP Address [Current='${REPIP}']: ${idsCL[Default]}"
echo -en "${idsCL[LightCyan]}IP Address [Current='${idsCL[White]}${REPIP}${idsCL[LightCyan]}']: ${idsCL[Default]}"
read -e IPADDRESS
[ "${IPADDRESS}" == "" ] && IPADDRESS=${REPIP}
echo
REPSUB=`/sbin/ifconfig eth0 | awk '/netmask/{ print $4;} '`
echo -en "${idsCL[LightCyan]}Subnet Mask [Current='${REPSUB}']: ${idsCL[Default]}"
echo -en "${idsCL[LightCyan]}Subnet Mask [Current='${idsCL[White]}${REPSUB}${idsCL[LightCyan]}']: ${idsCL[Default]}"
read -e SUBNET
[ "${SUBNET}" == "" ] && SUBNET=${REPSUB}
echo
REPGW=`route -n | grep 'UG[ \t]' | awk '{print $2}'`
echo -en "${idsCL[LightCyan]}Gateway IP [Current='${REPGW}']: ${idsCL[Default]}"
echo -en "${idsCL[LightCyan]}Gateway IP [Current='${idsCL[White]}${REPGW}${idsCL[LightCyan]}']: ${idsCL[Default]}"
read -e GATEWAY
[ "${GATEWAY}" == "" ] && GATEWAY=${REPGW}
echo
REPPRIDNS=`resolvectl -i eth0 dns | awk '/eth0/{ print $4;} '`
echo -en "${idsCL[LightCyan]}Primary DNS [Current='${REPPRIDNS}']: ${idsCL[Default]}"
echo -en "${idsCL[LightCyan]}Primary DNS [Current='${idsCL[White]}${REPPRIDNS}${idsCL[LightCyan]}']: ${idsCL[Default]}"
read -e PRIDNS
[ "${PRIDNS}" == "" ] && PRIDNS=${REPPRIDNS}
echo
REPSECDNS=`resolvectl -i eth0 dns | awk '/eth0/{ print $5;} '`
echo -en "${idsCL[LightCyan]}Secondary DNS (optional) [Current='${REPSECDNS}']: ${idsCL[Default]}"
echo -en "${idsCL[LightCyan]}Secondary DNS (optional) [Current='${idsCL[White]}${REPSECDNS}${idsCL[LightCyan]}']: ${idsCL[Default]}"
read -e SECDNS
[ "${SECDNS}" == "" ] && SECDNS=${REPSECDNS}
echo
@@ -942,7 +945,8 @@ MMSETUP(){
echo -e "${idsCL[LightCyan]}Primary DNS : ${idsCL[Green]}${PRIDNS}${idsCL[Default]}"
echo -e "${idsCL[LightCyan]}Secondary DNS : ${idsCL[Green]}${SECDNS}${idsCL[Default]}"
echo
read -n 1 -p "Is this correct (Y/n)?" choice
echo -en "${idsCL[LightCyan]}Is this correct (Y/n)? ${idsCL[Default]}"
read -n 1 choice
case "$choice" in
[Nn]) MMSETUP; exit 0;;
esac
@@ -972,7 +976,8 @@ MMSETUP(){
;;
esac
read -n 1 -p "This will reset the MM app config, do you wish to continue (y/N)?" choice
echo -en "${idsCL[LightCyan]}This will reset the MM app config, do you wish to continue (y/N)? ${idsCL[Default]}"
read -n 1 choice
case "$choice" in
[Yy])
echo
@@ -1015,7 +1020,8 @@ MMSETUP(){
echo -e "${idsCL[LightCyan]}You may choose to setup notifications by either SMTP and/or Pushover:${idsCL[Default]}"
if [ "${EMAIL_NOTICE}" != "" ]; then
read -n 1 -p "Use previous email address [${EMAIL_NOTICE}] (Y/n)? " choice
echo -en "${idsCL[LightCyan]}Use previous email address [${EMAIL_NOTICE}] (Y/n)? ${idsCL[Default]}"
read -n 1 choice
case "$choice" in
[Nn]) EMAIL_NOTICE="";;esac
fi
@@ -1027,7 +1033,8 @@ MMSETUP(){
echo
if [ "${PUSHOVER_APP_TOKEN}" != "" ]; then
read -n 1 -p "Use previous Pushover App Token [${PUSHOVER_APP_TOKEN}] (Y/n)?" choice
echo -en "${idsCL[LightCyan]}Use previous Pushover App Token [${PUSHOVER_APP_TOKEN}] (Y/n)? ${idsCL[Default]}"
read -n 1 choice
case "$choice" in
[Nn]) PUSHOVER_APP_TOKEN="";;esac
fi
@@ -1040,7 +1047,8 @@ MMSETUP(){
echo
if [ "${PUSHOVER_APP_TOKEN}" != "" ]; then
if [ "${PUSHOVER_USER_TOKEN}" != "" ]; then
read -n 1 -p "Use previous Pushover User Token [${PUSHOVER_USER_TOKEN}] (Y/n)?" choice
echo -en "${idsCL[LightCyan]}Use previous Pushover User Token [${PUSHOVER_USER_TOKEN}] (Y/n)? ${idsCL[Default]}"
read -n 1 choice
case "$choice" in
[Nn]) PUSHOVER_USER_TOKEN="";;esac
fi
@@ -1057,7 +1065,8 @@ MMSETUP(){
source /opt/idssys/mediamanager/settings.conf
IFS=,; SERVICES_CHECK=(${SERVICESCHECK}); unset IFS
read -n 1 -p "Would you like to update media management services [${srvcs2}] (Y/n)?" choice
echo -en "${idsCL[LightCyan]}Would you like to update media management services [${srvcs2}] (Y/n)? ${idsCL[Default]}"
read -n 1 choice
case "$choice" in
[Nn]) tmp='';;
* ) for usrvc in "${UPDATE_SERVICES[@]}"; do
@@ -1074,14 +1083,16 @@ MMSETUP(){
if [ "${NETCHNG}" == "true" ] || [ "${CNFG}" == "true" ]; then
if [ "${NETCHNG}" == "true" ]; then
echo
read -n 1 -p "A reboot is recommended, would you like to reboot now (Y/n)?" choice
echo -en "${idsCL[LightCyan]}A reboot is recommended, would you like to reboot now (Y/n)? ${idsCL[Default]}"
read -n 1 choice
case "$choice" in
[Nn]) echo;;
* ) reboot;;
esac
else
echo
read -n 1 -p "Would you like to start media management services (y/N)?" choice
echo -en "${idsCL[LightCyan]}Would you like to start media management services (y/N)? ${idsCL[Default]}"
read -n 1 choice
echo
case "$choice" in
[Yy]) MMSTART start;;