From 46f89c38a742772a7b0a9ef3d0c27dcf6a7c4c79 Mon Sep 17 00:00:00 2001 From: Henric Andersson Date: Sat, 19 Sep 2015 09:50:00 -0700 Subject: [PATCH] Fixed issue where ~ is used in DOWNLOADDIR Some commands don't like it when a path has ~ in it, so now we convert that into a regular path. --- plexupdate.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plexupdate.sh b/plexupdate.sh index 6178af1..b092d92 100755 --- a/plexupdate.sh +++ b/plexupdate.sh @@ -131,6 +131,17 @@ if [ "${AUTOINSTALL}" == "yes" ]; then fi fi +# Make sure download directory is sane +if [ ! -d "${DOWNLOADDIR}" ]; then + echo "Error: Download directory does not exist or is not a directory" + exit 1 +fi + +# Remove any ~ or other oddness in the path we're given +eval pushd "${DOWNLOADDIR}" > /dev/null +DOWNLOADDIR="$(pwd)" +popd > /dev/null + # Detect if we're running on redhat instead of ubuntu REDHAT=no; PKGEXT='.deb'