From 24dd899bf53d1431d420fa8bcdbec99133aedcc9 Mon Sep 17 00:00:00 2001 From: Alex Malinovich Date: Fri, 25 Nov 2016 20:17:00 -0800 Subject: [PATCH] Double-check for files to stat in .plexupdate check --- plexupdate.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plexupdate.sh b/plexupdate.sh index a86fdf5..a40f143 100755 --- a/plexupdate.sh +++ b/plexupdate.sh @@ -262,7 +262,9 @@ if ! hash wget 2>/dev/null; then fi #FIXME: Temporary error checking to notify people of change from .plexupdate to plexupdate.conf -if [ -z "${CONFIGFILE}" -a -f ~/.plexupdate -a ! -f /etc/plexupdate.conf ] || [ `stat -Lc %i "${CONFIGFILE}"` == `stat -Lc %i ~/.plexupdate` ]; then +# We have to double-check that both files exist before trying to stat them. This is going away soon. +if [ -z "${CONFIGFILE}" -a -f ~/.plexupdate -a ! -f /etc/plexupdate.conf ] || \ + [ -f "${CONFIGFILE}" -a -f ~/.plexupdate ] && [ `stat -Lc %i "${CONFIGFILE}"` == `stat -Lc %i ~/.plexupdate` ]; then warn ".plexupdate has been deprecated. You should move your configuration to /etc/plexupdate.conf" if [ -t 1 ]; then for i in `seq 1 5`; do echo -n .\ ; sleep 1; done