From 653588d43cff70c7be483c0149cc413945610993 Mon Sep 17 00:00:00 2001 From: Henric Andersson Date: Fri, 6 Nov 2015 08:55:56 -0800 Subject: [PATCH] Auto update now handles some more obscure situations Launch plexupdate using "bash plexupdate.sh" will not cause the autoupdate function to fail anymore. Also tries to handle the error if it would fail. --- plexupdate.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plexupdate.sh b/plexupdate.sh index 2adcf1c..35ec95a 100755 --- a/plexupdate.sh +++ b/plexupdate.sh @@ -121,7 +121,16 @@ if [ "${AUTOUPDATE}" == "yes" ]; then fi echo "OK" popd >/dev/null - $0 ${ALLARGS} -U + if ! type "$0" 2>/dev/null >/dev/null ; then + if [ -f "$0" ]; then + /bin/bash "$0" ${ALLARGS} -U + else + echo "Error: Unable to relaunch, couldn't find $0" + exit 1 + fi + else + "$0" ${ALLARGS} -U + fi exit $? fi