jesus fucvk fix4es
This commit is contained in:
@@ -27,17 +27,18 @@ binDir="$ESPIDFTOOLS_INSTALLDIR/.custom_bin"
|
|||||||
|
|
||||||
echo -e "\nChecking for Serial Devices in dmesg\n"
|
echo -e "\nChecking for Serial Devices in dmesg\n"
|
||||||
COUNTER=0
|
COUNTER=0
|
||||||
devarr=()
|
# devarr=()
|
||||||
|
declare -a devarr
|
||||||
for line in $(dmesg | tail -50 | grep -o -E "tty[A-Z]{3}[0-9]{0,2}" | sort -u); do
|
for line in $(dmesg | tail -50 | grep -o -E "tty[A-Z]{3}[0-9]{0,2}" | sort -u); do
|
||||||
echo -e "$COUNTER /dev/$line"
|
echo -e "$COUNTER /dev/$line"
|
||||||
devarr[$COUNTER]="/dev/$line"
|
devarr[$COUNTER]="/dev/$line"
|
||||||
COUNTER=$((COUNTER+1))
|
COUNTER=$(($COUNTER+1))
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ $COUNTER -gt 0 ]; then
|
if [ $COUNTER -gt 0 ]; then
|
||||||
echo -e "\nEnter TTY Number You'd Like:"
|
echo -e "\nEnter TTY Number You'd Like:"
|
||||||
read tty
|
read tty
|
||||||
ttyselect=${devarr[$tty]}
|
ttyselect="${devarr[$tty]}"
|
||||||
else
|
else
|
||||||
echo -e "\nNo Serial Devices Found, Select one later with 'changeport'\n"
|
echo -e "\nNo Serial Devices Found, Select one later with 'changeport'\n"
|
||||||
fi
|
fi
|
||||||
@@ -47,9 +48,9 @@ read esp
|
|||||||
|
|
||||||
# echo -e "\nSetting environment variables\n"
|
# echo -e "\nSetting environment variables\n"
|
||||||
export PATH="$ESPIDFTOOLS_INSTALLDIR/.custom_bin:$PATH"
|
export PATH="$ESPIDFTOOLS_INSTALLDIR/.custom_bin:$PATH"
|
||||||
export ESPPORT=$ttyselect
|
export ESPPORT="$ttyselect"
|
||||||
export ESPBAUD=460800
|
export ESPBAUD=460800
|
||||||
export ESPTARGET=$esp
|
export ESPTARGET="$esp"
|
||||||
export examples="$ESPIDFTOOLS_INSTALLDIR/esp-idf/examples"
|
export examples="$ESPIDFTOOLS_INSTALLDIR/esp-idf/examples"
|
||||||
|
|
||||||
echo -e "Installation Variables:"
|
echo -e "Installation Variables:"
|
||||||
|
|||||||
@@ -7,19 +7,19 @@ function subprocess() {
|
|||||||
for line in $(dmesg | tail -50 | grep -o -E "tty[A-Z]{3}[0-9]{0,2}" | sort -u); do
|
for line in $(dmesg | tail -50 | grep -o -E "tty[A-Z]{3}[0-9]{0,2}" | sort -u); do
|
||||||
echo -e "$COUNTER /dev/$line"
|
echo -e "$COUNTER /dev/$line"
|
||||||
devarr+=("/dev/$line")
|
devarr+=("/dev/$line")
|
||||||
COUNTER=$((COUNTER+1))
|
COUNTER=$(($COUNTER+1))
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ $COUNTER -gt 0 ]; then
|
if [ $COUNTER -gt 0 ]; then
|
||||||
echo -e "\nEnter TTY Number You'd Like:"
|
echo -e "\nEnter TTY Number You'd Like:"
|
||||||
read tty
|
read tty
|
||||||
ttyselect=$devarr[$tty+1]
|
ttyselect="${devarr[$tty+1]}"
|
||||||
else
|
else
|
||||||
echo -e "\nNo Serial Devices Found, Select one later with 'changeport'\n"
|
echo -e "\nNo Serial Devices Found, Select one later with 'changeport'\n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sel=$tty+1
|
sel=$tty+1
|
||||||
eval "$1=$devarr[$sel]"
|
eval "$1=${devarr[$sel]}"
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@@ -31,7 +31,7 @@ else
|
|||||||
subprocess ret
|
subprocess ret
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export ESPPORT=$ret
|
export ESPPORT="$ret"
|
||||||
|
|
||||||
echo -e "\nESPPORT set to $ESPPORT\n"
|
echo -e "\nESPPORT set to $ESPPORT\n"
|
||||||
echo -e "\nAll done :3\n"
|
echo -e "\nAll done :3\n"
|
||||||
Reference in New Issue
Block a user