From 5067fc91dc8634b79e361d84196a18048da80bad Mon Sep 17 00:00:00 2001 From: Alex Malinovich Date: Fri, 9 Mar 2018 00:26:05 -0800 Subject: [PATCH] Add verbose output for version checking --- plexupdate-core | 8 ++++++++ plexupdate.sh | 7 ++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/plexupdate-core b/plexupdate-core index 8ea4fc4..208915d 100755 --- a/plexupdate-core +++ b/plexupdate-core @@ -240,6 +240,14 @@ getPlexVersion() { fi } +verboseOutput() { + if [ "$VERBOSE" = "yes" ]; then + for i in $@; do + info "$i=${!i}" + done + fi +} + # Shared functions # SHARED diff --git a/plexupdate.sh b/plexupdate.sh index 0a50cd7..f34f8ce 100755 --- a/plexupdate.sh +++ b/plexupdate.sh @@ -385,11 +385,7 @@ RELEASE=$(grep -ioe '"label"[^}]*' <<<"${wgetresults}" | grep -i "\"distro\":\"$ DOWNLOAD=$(echo ${RELEASE} | grep -m1 -ioe 'https://[^\"]*') CHECKSUM=$(echo ${RELEASE} | grep -ioe '\"checksum\"\:\"[^\"]*' | sed 's/\"checksum\"\:\"//') -if [ "$VERBOSE" = "yes" ]; then - for i in RELEASE DOWNLOAD CHECKSUM; do - info "$i=${!i}" - done -fi +verboseOutput RELEASE DOWNLOAD CHECKSUM if [ -z "${DOWNLOAD}" ]; then if [ "$DISTRO" = "ubuntu" -a "$BUILD" = "linux-ubuntu-armv7l" ]; then @@ -425,6 +421,7 @@ SKIP_DOWNLOAD="no" INSTALLED_VERSION="$(getPlexVersion)" || warn "Unable to detect installed version, first time?" FILE_VERSION="$(cut -f2 -d_ <<< "${FILENAME}")" +verboseOutput INSTALLED_VERSION FILE_VERSION if [ "${REDHAT}" = "yes" -a "${AUTOINSTALL}" = "yes" -a "${AUTOSTART}" = "no" ]; then warn "Your distribution may require the use of the AUTOSTART [-s] option for the service to start after the upgrade completes."