Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
Add argument task to setup.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
forno committed Nov 3, 2016
1 parent 55624f7 commit c2dcd58
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions script/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,29 @@ invalidPID(){
[ $1 -lt 9 ] && return 1
return 0
}

echo "Please select your device"
echo "1. ICS USB ADAPTER"
echo "2. SERIAL USB ADAPTER"
echo "3~5: nothing"
echo "6. ICS USB ADAPTER HS"
echo "7. SERIAL USB ADAPTER HS"
echo "8. DUAl USB ADAPTER HS"
read onePID
expr $onePID + 1 > /dev/null 2>&1
INTCHECK=$?
if [ $INTCHECK -gt 1 ]; then
echo "Invalid argument"
return 1
if [ $# -gt 0 ]; then
expr $1 + 1 > /dev/null 2>&1
inputCheck=$?
else
inputCheck=5
fi
if [ $inputCheck -gt 1 ]; then
echo "Please select your device"
echo "1. ICS USB ADAPTER"
echo "2. SERIAL USB ADAPTER"
echo "3~5: nothing"
echo "6. ICS USB ADAPTER HS"
echo "7. SERIAL USB ADAPTER HS"
echo "8. DUAl USB ADAPTER HS"
read onePID
expr $onePID + 1 > /dev/null 2>&1
INTCHECK=$?
if [ $INTCHECK -gt 1 ]; then
echo "Invalid argument"
return 1
fi
else
onePID=$1
fi
if invalidPID $onePID; then
echo "Out of range"
Expand Down

0 comments on commit c2dcd58

Please sign in to comment.