From 02f34542e72e096be1f9dcc3c0c24bdb3c519401 Mon Sep 17 00:00:00 2001 From: Henric Andersson Date: Sun, 20 Nov 2016 18:58:58 -0800 Subject: [PATCH] Give existing users explaination as to why plexupdate.sh failed We must make sure to tell existing users about the change in behavior. If they used ~/.plexupdate it will now properly warn them about the change and exit out. --- plexupdate.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plexupdate.sh b/plexupdate.sh index ff45be0..ab08b92 100755 --- a/plexupdate.sh +++ b/plexupdate.sh @@ -264,8 +264,15 @@ if ! hash wget 2>/dev/null; then fi # If a config file was specified, or if /etc/plexupdate.conf exists, we'll use it. Otherwise, just skip it. - -source "${CONFIGFILE:-"/etc/plexupdate.conf"}" 2>/dev/null +if [ -z "${CONFIGFILE}" ]; then + if [ -f "/etc/plexupdate.conf" ]; then + CONFIGFILE=/etc/plexupdate.conf + else + error "Due to recent changes, config file must be specified or placed in /etc/plexupdate.conf" + exit 1 + fi +fi +source "${CONFIGFILE}" 2>/dev/null # DO NOT ALLOW VERBOSE FROM CONFIGURATION FILE! if [ "${VERBOSE_CL}" = "yes" ]; then