diff --git a/plexupdate.sh b/plexupdate.sh index 5027f5f..f760544 100755 --- a/plexupdate.sh +++ b/plexupdate.sh @@ -156,11 +156,13 @@ trimQuotes() { echo $__buffer } -HASCFG="${@: -1}" -if [ ! -z "${HASCFG}" -a ! "${HASCFG:0:1}" = "-" -a ! "${@:(-2):1}" = "--config" ]; then - if [ -f "${HASCFG}" ]; then - echo "WARNING: Specifying config file as last argument is deprecated. Use --config instead." - CONFIGFILE=${HASCFG} +if [ ! $# -eq 0 ]; then + HASCFG="${@: -1}" + if [ ! -z "${HASCFG}" -a ! "${HASCFG:0:1}" = "-" -a ! "${@:(-2):1}" = "--config" ]; then + if [ -f "${HASCFG}" ]; then + echo "WARNING: Specifying config file as last argument is deprecated. Use --config instead." + CONFIGFILE=${HASCFG} + fi fi fi