Update mm-scripts.sh

This commit is contained in:
2023-04-22 17:45:07 -05:00
parent 475024de15
commit 0a808f8c4a

View File

@@ -906,33 +906,33 @@ MMSETUP(){
case "$choice" in case "$choice" in
[Yy]) [Yy])
echo echo
echo -en "${idsCL[LightCyan]}Hostname [Default='${idsCL[White]}Media-Manager${idsCL[LightCyan]}']: ${idsCL[Default]}" echo -en "${idsCL[LightYellow]}Hostname [Default='${idsCL[White]}Media-Manager${idsCL[LightYellow]}']: ${idsCL[Default]}"
read -e HOSTNAME read -e HOSTNAME
[ "${HOSTNAME}" == "" ] && HOSTNAME="Media-Manager" [ "${HOSTNAME}" == "" ] && HOSTNAME="Media-Manager"
echo echo
REPIP=`hostname -I` REPIP=`hostname -I`
REPIP=${REPIP/ /} REPIP=${REPIP/ /}
echo -en "${idsCL[LightCyan]}IP Address [Current='${idsCL[White]}${REPIP}${idsCL[LightCyan]}']: ${idsCL[Default]}" echo -en "${idsCL[LightYellow]}IP Address [Current='${idsCL[White]}${REPIP}${idsCL[LightYellow]}']: ${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='${idsCL[White]}${REPSUB}${idsCL[LightCyan]}']: ${idsCL[Default]}" echo -en "${idsCL[LightYellow]}Subnet Mask [Current='${idsCL[White]}${REPSUB}${idsCL[LightYellow]}']: ${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='${idsCL[White]}${REPGW}${idsCL[LightCyan]}']: ${idsCL[Default]}" echo -en "${idsCL[LightYellow]}Gateway IP [Current='${idsCL[White]}${REPGW}${idsCL[LightYellow]}']: ${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='${idsCL[White]}${REPPRIDNS}${idsCL[LightCyan]}']: ${idsCL[Default]}" echo -en "${idsCL[LightYellow]}Primary DNS [Current='${idsCL[White]}${REPPRIDNS}${idsCL[LightYellow]}']: ${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='${idsCL[White]}${REPSECDNS}${idsCL[LightCyan]}']: ${idsCL[Default]}" echo -en "${idsCL[LightYellow]}Secondary DNS (optional) [Current='${idsCL[White]}${REPSECDNS}${idsCL[LightYellow]}']: ${idsCL[Default]}"
read -e SECDNS read -e SECDNS
[ "${SECDNS}" == "" ] && SECDNS=${REPSECDNS} [ "${SECDNS}" == "" ] && SECDNS=${REPSECDNS}
echo echo
@@ -1020,26 +1020,26 @@ 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
echo -en "${idsCL[LightCyan]}Use previous email address [${EMAIL_NOTICE}] (Y/n)? ${idsCL[Default]}" echo -en "${idsCL[LightYellow]}Use previous email address [${idsCL[White]}${EMAIL_NOTICE}${idsCL[LightYellow]}] (Y/n)? ${idsCL[Default]}"
read -n 1 choice read -n 1 choice
case "$choice" in case "$choice" in
[Nn]) EMAIL_NOTICE="";;esac [Nn]) EMAIL_NOTICE="";;esac
fi fi
if [ "${EMAIL_NOTICE}" == "" ]; then if [ "${EMAIL_NOTICE}" == "" ]; then
echo; echo -e -n "${idsCL[LightCyan]}(optional) Email notification address: ${idsCL[Default]}" echo; echo -e -n "${idsCL[LightYellow]}(optional) Email notification address: ${idsCL[Default]}"
read -e EMAIL_NOTICE read -e EMAIL_NOTICE
fi fi
[ "${EMAIL_NOTICE}" != "" ] && echo "EMAIL_NOTICE=${EMAIL_NOTICE}" >> ${MMFOLDER}/settings.conf || echo "# EMAIL_NOTICE=email@address.com" >> ${MMFOLDER}/settings.conf [ "${EMAIL_NOTICE}" != "" ] && echo "EMAIL_NOTICE=${EMAIL_NOTICE}" >> ${MMFOLDER}/settings.conf || echo "# EMAIL_NOTICE=email@address.com" >> ${MMFOLDER}/settings.conf
echo echo
if [ "${PUSHOVER_APP_TOKEN}" != "" ]; then if [ "${PUSHOVER_APP_TOKEN}" != "" ]; then
echo -en "${idsCL[LightCyan]}Use previous Pushover App Token [${PUSHOVER_APP_TOKEN}] (Y/n)? ${idsCL[Default]}" echo -en "${idsCL[LightYellow]}Use previous Pushover App Token [${idsCL[White]}${PUSHOVER_APP_TOKEN}${idsCL[LightYellow]}] (Y/n)? ${idsCL[Default]}"
read -n 1 choice read -n 1 choice
case "$choice" in case "$choice" in
[Nn]) PUSHOVER_APP_TOKEN="";;esac [Nn]) PUSHOVER_APP_TOKEN="";;esac
fi fi
if [ "${PUSHOVER_APP_TOKEN}" == "" ]; then if [ "${PUSHOVER_APP_TOKEN}" == "" ]; then
echo; echo -e -n "${idsCL[LightCyan]}(optional) Pushover App Token: ${idsCL[Default]}" echo; echo -e -n "${idsCL[LightYellow]}(optional) Pushover App Token: ${idsCL[Default]}"
read -e PUSHOVER_APP_TOKEN read -e PUSHOVER_APP_TOKEN
fi fi
[ "${PUSHOVER_APP_TOKEN}" != "" ] && echo "PUSHOVER_APP_TOKEN=${PUSHOVER_APP_TOKEN}" >> ${MMFOLDER}/settings.conf || echo "# PUSHOVER_APP_TOKEN=\"\"" >> ${MMFOLDER}/settings.conf [ "${PUSHOVER_APP_TOKEN}" != "" ] && echo "PUSHOVER_APP_TOKEN=${PUSHOVER_APP_TOKEN}" >> ${MMFOLDER}/settings.conf || echo "# PUSHOVER_APP_TOKEN=\"\"" >> ${MMFOLDER}/settings.conf
@@ -1047,13 +1047,13 @@ MMSETUP(){
echo echo
if [ "${PUSHOVER_APP_TOKEN}" != "" ]; then if [ "${PUSHOVER_APP_TOKEN}" != "" ]; then
if [ "${PUSHOVER_USER_TOKEN}" != "" ]; then if [ "${PUSHOVER_USER_TOKEN}" != "" ]; then
echo -en "${idsCL[LightCyan]}Use previous Pushover User Token [${PUSHOVER_USER_TOKEN}] (Y/n)? ${idsCL[Default]}" echo -en "${idsCL[LightYellow]}Use previous Pushover User Token [${idsCL[White]}${PUSHOVER_USER_TOKEN}${idsCL[LightYellow]}] (Y/n)? ${idsCL[Default]}"
read -n 1 choice read -n 1 choice
case "$choice" in case "$choice" in
[Nn]) PUSHOVER_USER_TOKEN="";;esac [Nn]) PUSHOVER_USER_TOKEN="";;esac
fi fi
if [ "${PUSHOVER_USER_TOKEN}" == "" ]; then if [ "${PUSHOVER_USER_TOKEN}" == "" ]; then
echo; echo -e -n "${idsCL[LightCyan]}(optional) Pushover User Token: ${idsCL[Default]}" echo; echo -e -n "${idsCL[LightYellow]}(optional) Pushover User Token: ${idsCL[Default]}"
read -e PUSHOVER_USER_TOKEN read -e PUSHOVER_USER_TOKEN
fi fi
[ "${PUSHOVER_USER_TOKEN}" != "" ] && echo "PUSHOVER_USER_TOKEN=${PUSHOVER_USER_TOKEN}" >> ${MMFOLDER}/settings.conf || echo "# PUSHOVER_USER_TOKEN=\"\"" >> ${MMFOLDER}/settings.conf [ "${PUSHOVER_USER_TOKEN}" != "" ] && echo "PUSHOVER_USER_TOKEN=${PUSHOVER_USER_TOKEN}" >> ${MMFOLDER}/settings.conf || echo "# PUSHOVER_USER_TOKEN=\"\"" >> ${MMFOLDER}/settings.conf
@@ -1065,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
echo -en "${idsCL[LightCyan]}Would you like to update media management services [${srvcs2}] (Y/n)? ${idsCL[Default]}" echo -en "${idsCL[LightCyan]}Would you like to update media management services:"
echo -en "${idsCL[LightYellow]}[${idsCL[White]}${srvcs2}${idsCL[LightYellow]}] (Y/n)? ${idsCL[Default]}"
read -n 1 choice read -n 1 choice
case "$choice" in case "$choice" in
[Nn]) tmp='';; [Nn]) tmp='';;