From e1673a90a1ac62b743fdf16083cddd8513ad781e Mon Sep 17 00:00:00 2001 From: Martin Kepplinger Date: Tue, 14 May 2019 09:35:36 +0200 Subject: [PATCH] x230: add verbose output for the upgrade script --- x230/upgrade.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/x230/upgrade.sh b/x230/upgrade.sh index f32880d..77f9fb9 100755 --- a/x230/upgrade.sh +++ b/x230/upgrade.sh @@ -13,19 +13,24 @@ usage() echo " This script checks if there's a newer" echo " release of the X230 Skulls package available." echo "" - echo "Usage: $0" + echo "Usage: $0 [-v]" } -args=$(getopt -o h -- "$@") +args=$(getopt -o hv -- "$@") if [ $? -ne 0 ] ; then usage exit 1 fi +verbose=0 + eval set -- "$args" while [ $# -gt 0 ] do case "$1" in + -v) + verbose=1 + ;; -h) usage exit 1 @@ -58,6 +63,10 @@ if [[ -z "$UPSTREAM_X230" ]] ; then exit 0 fi +if [[ $verbose -gt 0 ]] ; then + echo "This is v$CURRENT_VERSION and latest is v$UPSTREAM_VERSION" +fi + if [[ "$CURRENT_VERSION" = "$UPSTREAM_VERSION" ]] ; then echo -e "${GREEN}You are using the latest version of Skulls for the X230${NC}" exit 0