From 81f44ad707f86335152ca9627715de82d15505f1 Mon Sep 17 00:00:00 2001 From: Dana Lewis Date: Sun, 5 Feb 2017 17:07:05 -0800 Subject: [PATCH 1/3] Attempting to add explorer board prompt to setup script to resolve common error and confusion --- bin/oref0-setup.sh | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/bin/oref0-setup.sh b/bin/oref0-setup.sh index a4934771..00570196 100755 --- a/bin/oref0-setup.sh +++ b/bin/oref0-setup.sh @@ -145,15 +145,23 @@ if [[ -z "$DIR" || -z "$serial" ]]; then BLE_SERIAL=$REPLY echo "$BLE_SERIAL? Got it." fi - read -p "Are you using mmeowlink? If not, press enter. If so, what TTY port (full port address, looks like "/dev/ttySOMETHING" without the quotes - you probably want to copy paste it)? " -r - ttyport=$REPLY - echo -n "Ok, " - if [[ -z "$ttyport" ]]; then - echo -n Carelink + +if + read -p "Are you using an Explorer Board? [Y/n] -r + if [[ $REPLY =~ ^[Yy]$ ]]; then + ttyport=$/dev/spidev5.1 else - echo -n TTY $ttyport - fi - echo " it is." + read -p "Are you using mmeowlink (i.e. with a TI stick)? If not, press enter. If so, what TTY port (full port address, looks like "/dev/ttySOMETHING" without the quotes - you probably want to copy paste it)? " -r + ttyport=$REPLY + echo -n "Ok, " + if [[ -z "$ttyport" ]]; then + echo -n Carelink + else + echo -n TTY $ttyport + fi + echo " it is." +fi + if [[ ! -z "${ttyport}" ]]; then echo "Medtronic pumps come in two types: WW (Worldwide) pumps, and NA (North America) pumps." From 43d3dd56be16ac1d97632455c164d96f5a39447d Mon Sep 17 00:00:00 2001 From: Dana Lewis Date: Sun, 5 Feb 2017 17:40:57 -0800 Subject: [PATCH 2/3] Fix bugs. Be awesome. --- bin/oref0-setup.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bin/oref0-setup.sh b/bin/oref0-setup.sh index 00570196..0ee3029f 100755 --- a/bin/oref0-setup.sh +++ b/bin/oref0-setup.sh @@ -146,12 +146,13 @@ if [[ -z "$DIR" || -z "$serial" ]]; then echo "$BLE_SERIAL? Got it." fi -if - read -p "Are you using an Explorer Board? [Y/n] -r + + read -p "Are you using an Explorer Board? [Y/n] " -r if [[ $REPLY =~ ^[Yy]$ ]]; then - ttyport=$/dev/spidev5.1 + ttyport=/dev/spidev5.1 + echo -n "Ok, yay for Explorer Board! " else - read -p "Are you using mmeowlink (i.e. with a TI stick)? If not, press enter. If so, what TTY port (full port address, looks like "/dev/ttySOMETHING" without the quotes - you probably want to copy paste it)? " -r + read -p 'Are you using mmeowlink (i.e. with a TI stick)? If not, press enter. If so, what TTY port (full port address, looks like "/dev/ttySOMETHING" without the quotes - you probably want to copy paste it)? ' -r ttyport=$REPLY echo -n "Ok, " if [[ -z "$ttyport" ]]; then @@ -159,8 +160,8 @@ if else echo -n TTY $ttyport fi - echo " it is." -fi + echo " it is. " + fi if [[ ! -z "${ttyport}" ]]; then From d1de679b608db76c50db8142cb0adcc8028b4506 Mon Sep 17 00:00:00 2001 From: Dana Lewis Date: Sun, 5 Feb 2017 17:44:08 -0800 Subject: [PATCH 3/3] Remove a stray -n for readability --- bin/oref0-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/oref0-setup.sh b/bin/oref0-setup.sh index 0ee3029f..79053260 100755 --- a/bin/oref0-setup.sh +++ b/bin/oref0-setup.sh @@ -150,7 +150,7 @@ if [[ -z "$DIR" || -z "$serial" ]]; then read -p "Are you using an Explorer Board? [Y/n] " -r if [[ $REPLY =~ ^[Yy]$ ]]; then ttyport=/dev/spidev5.1 - echo -n "Ok, yay for Explorer Board! " + echo "Ok, yay for Explorer Board! " else read -p 'Are you using mmeowlink (i.e. with a TI stick)? If not, press enter. If so, what TTY port (full port address, looks like "/dev/ttySOMETHING" without the quotes - you probably want to copy paste it)? ' -r ttyport=$REPLY