Update mm-scripts.sh
This commit is contained in:
@@ -331,7 +331,8 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f ${MMFOLDER}/mm.plexmount.fail ] && [ "${1}" == "start" ] && [ "${2}" != "vpn" ]; then
|
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
|
case "$choice" in
|
||||||
[Yy])
|
[Yy])
|
||||||
rm -f ${MMFOLDER}/mm.plexmount.fail*
|
rm -f ${MMFOLDER}/mm.plexmount.fail*
|
||||||
@@ -697,7 +698,8 @@ GETVPNINFO(){
|
|||||||
VPNSPEEDTEST(){
|
VPNSPEEDTEST(){
|
||||||
echo -e "${idsCL[Green]}VPN Speedtest Comparison${idsCL[Default]}"
|
echo -e "${idsCL[Green]}VPN Speedtest Comparison${idsCL[Default]}"
|
||||||
echo
|
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
|
case "$choice" in
|
||||||
[Nn]) exit 0;;
|
[Nn]) exit 0;;
|
||||||
esac
|
esac
|
||||||
@@ -725,7 +727,8 @@ VPNSPEEDTEST(){
|
|||||||
MMSTOP >/dev/null 2>&1
|
MMSTOP >/dev/null 2>&1
|
||||||
|
|
||||||
echo
|
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
|
echo
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
[Yy]) MMSTART start;;
|
[Yy]) MMSTART start;;
|
||||||
@@ -903,33 +906,33 @@ MMSETUP(){
|
|||||||
case "$choice" in
|
case "$choice" in
|
||||||
[Yy])
|
[Yy])
|
||||||
echo
|
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
|
read -e HOSTNAME
|
||||||
[ "${HOSTNAME}" == "" ] && HOSTNAME=`hostname`
|
[ "${HOSTNAME}" == "" ] && HOSTNAME="Media-Manager"
|
||||||
echo
|
echo
|
||||||
REPIP=`hostname -I`
|
REPIP=`hostname -I`
|
||||||
REPIP=${REPIP/ /}
|
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
|
read -e IPADDRESS
|
||||||
[ "${IPADDRESS}" == "" ] && IPADDRESS=${REPIP}
|
[ "${IPADDRESS}" == "" ] && IPADDRESS=${REPIP}
|
||||||
echo
|
echo
|
||||||
REPSUB=`/sbin/ifconfig eth0 | awk '/netmask/{ print $4;} '`
|
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
|
read -e SUBNET
|
||||||
[ "${SUBNET}" == "" ] && SUBNET=${REPSUB}
|
[ "${SUBNET}" == "" ] && SUBNET=${REPSUB}
|
||||||
echo
|
echo
|
||||||
REPGW=`route -n | grep 'UG[ \t]' | awk '{print $2}'`
|
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
|
read -e GATEWAY
|
||||||
[ "${GATEWAY}" == "" ] && GATEWAY=${REPGW}
|
[ "${GATEWAY}" == "" ] && GATEWAY=${REPGW}
|
||||||
echo
|
echo
|
||||||
REPPRIDNS=`resolvectl -i eth0 dns | awk '/eth0/{ print $4;} '`
|
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
|
read -e PRIDNS
|
||||||
[ "${PRIDNS}" == "" ] && PRIDNS=${REPPRIDNS}
|
[ "${PRIDNS}" == "" ] && PRIDNS=${REPPRIDNS}
|
||||||
echo
|
echo
|
||||||
REPSECDNS=`resolvectl -i eth0 dns | awk '/eth0/{ print $5;} '`
|
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
|
read -e SECDNS
|
||||||
[ "${SECDNS}" == "" ] && SECDNS=${REPSECDNS}
|
[ "${SECDNS}" == "" ] && SECDNS=${REPSECDNS}
|
||||||
echo
|
echo
|
||||||
@@ -942,7 +945,8 @@ MMSETUP(){
|
|||||||
echo -e "${idsCL[LightCyan]}Primary DNS : ${idsCL[Green]}${PRIDNS}${idsCL[Default]}"
|
echo -e "${idsCL[LightCyan]}Primary DNS : ${idsCL[Green]}${PRIDNS}${idsCL[Default]}"
|
||||||
echo -e "${idsCL[LightCyan]}Secondary DNS : ${idsCL[Green]}${SECDNS}${idsCL[Default]}"
|
echo -e "${idsCL[LightCyan]}Secondary DNS : ${idsCL[Green]}${SECDNS}${idsCL[Default]}"
|
||||||
echo
|
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
|
case "$choice" in
|
||||||
[Nn]) MMSETUP; exit 0;;
|
[Nn]) MMSETUP; exit 0;;
|
||||||
esac
|
esac
|
||||||
@@ -972,7 +976,8 @@ MMSETUP(){
|
|||||||
;;
|
;;
|
||||||
esac
|
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
|
case "$choice" in
|
||||||
[Yy])
|
[Yy])
|
||||||
echo
|
echo
|
||||||
@@ -1015,7 +1020,8 @@ MMSETUP(){
|
|||||||
echo -e "${idsCL[LightCyan]}You may choose to setup notifications by either SMTP and/or Pushover:${idsCL[Default]}"
|
echo -e "${idsCL[LightCyan]}You may choose to setup notifications by either SMTP and/or Pushover:${idsCL[Default]}"
|
||||||
|
|
||||||
if [ "${EMAIL_NOTICE}" != "" ]; then
|
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
|
case "$choice" in
|
||||||
[Nn]) EMAIL_NOTICE="";;esac
|
[Nn]) EMAIL_NOTICE="";;esac
|
||||||
fi
|
fi
|
||||||
@@ -1027,7 +1033,8 @@ MMSETUP(){
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
if [ "${PUSHOVER_APP_TOKEN}" != "" ]; then
|
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
|
case "$choice" in
|
||||||
[Nn]) PUSHOVER_APP_TOKEN="";;esac
|
[Nn]) PUSHOVER_APP_TOKEN="";;esac
|
||||||
fi
|
fi
|
||||||
@@ -1040,7 +1047,8 @@ MMSETUP(){
|
|||||||
echo
|
echo
|
||||||
if [ "${PUSHOVER_APP_TOKEN}" != "" ]; then
|
if [ "${PUSHOVER_APP_TOKEN}" != "" ]; then
|
||||||
if [ "${PUSHOVER_USER_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
|
case "$choice" in
|
||||||
[Nn]) PUSHOVER_USER_TOKEN="";;esac
|
[Nn]) PUSHOVER_USER_TOKEN="";;esac
|
||||||
fi
|
fi
|
||||||
@@ -1057,7 +1065,8 @@ MMSETUP(){
|
|||||||
source /opt/idssys/mediamanager/settings.conf
|
source /opt/idssys/mediamanager/settings.conf
|
||||||
IFS=,; SERVICES_CHECK=(${SERVICESCHECK}); unset IFS
|
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
|
case "$choice" in
|
||||||
[Nn]) tmp='';;
|
[Nn]) tmp='';;
|
||||||
* ) for usrvc in "${UPDATE_SERVICES[@]}"; do
|
* ) for usrvc in "${UPDATE_SERVICES[@]}"; do
|
||||||
@@ -1074,14 +1083,16 @@ MMSETUP(){
|
|||||||
if [ "${NETCHNG}" == "true" ] || [ "${CNFG}" == "true" ]; then
|
if [ "${NETCHNG}" == "true" ] || [ "${CNFG}" == "true" ]; then
|
||||||
if [ "${NETCHNG}" == "true" ]; then
|
if [ "${NETCHNG}" == "true" ]; then
|
||||||
echo
|
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
|
case "$choice" in
|
||||||
[Nn]) echo;;
|
[Nn]) echo;;
|
||||||
* ) reboot;;
|
* ) reboot;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
echo
|
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
|
echo
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
[Yy]) MMSTART start;;
|
[Yy]) MMSTART start;;
|
||||||
|
|||||||
Reference in New Issue
Block a user