manual.sh minor bug fix

Issues were occurring where manual.sh could not accept incorrect channel input.  Now, if an invalid channel is input, you will simply be diverted to your first channel.  This can be changed later in many ways, one of which is to simply kill the script; I did not choose this since going to channel 1 kind of serves as an "error report" since you didn't make it to the channel you requested.
This commit is contained in:
mutto233
2018-06-30 18:16:38 -04:00
committed by GitHub
parent e633703fb2
commit 94f4223972

View File

@@ -127,6 +127,16 @@ if [ "${#CHANNEL_DIR_ARR[@]}" -gt 1 ]; then
NEXT_CHANNEL_DIR=${CHANNEL_DIR_SORTED[$i]}
break
fi
#echo "TESTING"
#echo $i
#echo ${#CHANNEL_DIR_NUMBERS[@]}
if [ $i -eq $((${#CHANNEL_DIR_NUMBERS[@]} - 1)) ]; then
echo "No NEXT CHANNEL MATCH found, reverting to first element"
NEXT_CHANNEL_DIR=${CHANNEL_DIR_SORTED[0]}
NEXT_CHANNEL=${CHANNEL_DIR_NUMBERS[0]}
fi
done
# This is our modified way of searching for the correct directory for the previous channel