From b6abdfb7262d68c3e0e3d60c3fc072289d699b2c Mon Sep 17 00:00:00 2001 From: cimryan Date: Tue, 23 Oct 2018 07:27:58 -0700 Subject: [PATCH] Simplified tests aren't compatible with bash -u. --- windows_archive/setup-teslausb | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/windows_archive/setup-teslausb b/windows_archive/setup-teslausb index 8be1acc..52dd5cc 100644 --- a/windows_archive/setup-teslausb +++ b/windows_archive/setup-teslausb @@ -2,15 +2,9 @@ USER_ENABLED_PUSHOVER=false -if [[ -z $REPO ]] -then - REPO=cimryan -fi +REPO=${REPO:-cimryan} -f [[ -z $BRANCH ]] -then - BRANCH=master -fi +BRANCH=${BRANCH:-master} if ! [ $(id -u) = 0 ] then @@ -28,9 +22,9 @@ function check_variable () { } function check_pushover_enabled () { - if [ "$pushover_enabled" = "true" ] + if [ ! -z "${pushover_enabled+x}" ] then - if [[ -z $pushover_user_key ]] || [[ -z $pushover_app_key ]] + if [ ! -n "${pushover_user_key+x}" ] || [ ! -n "${pushover_app_key+x}" ] then echo "STOP: You're trying to setup Pushover but didn't provide your User and/or App key." echo "Define the variables like this:"