1746839115
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
subprocess() {
|
||||
function subprocess() {
|
||||
echo -e "\nChanging ESPBAUD\n\t1: 9600\n\t2: 115200\n\t3: 230400\n\t4: 460800\n\t5: 1152000\n\t6: 1500000\n\nEnter Selection: "
|
||||
read baudRate
|
||||
echo -e "\n"
|
||||
@@ -12,7 +12,7 @@ subprocess() {
|
||||
esac
|
||||
|
||||
eval "$1=$selection"
|
||||
return 0;
|
||||
return 0
|
||||
}
|
||||
|
||||
if [ ! -z "$1" ]; then
|
||||
@@ -22,7 +22,6 @@ else
|
||||
subprocess ret
|
||||
fi
|
||||
|
||||
echo "ret: $ret"
|
||||
export ESPBAUD=$ret
|
||||
echo "\nBaudrate set to $ESPBAUD\n"
|
||||
echo "\nAll done :3\n"
|
||||
echo -e "\nBaudrate set to $ESPBAUD\n"
|
||||
echo -e "\nAll done :3\n"
|
||||
@@ -1,4 +1,4 @@
|
||||
subprocess() {
|
||||
function subprocess() {
|
||||
echo -e "\nChanging ESPTARGET\n"
|
||||
echo -e "Set esp target (esp32, esp32s3, esp32c6, esp8266, etc)"
|
||||
read esp
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
subprocess() {
|
||||
function subprocess() {
|
||||
echo -e "\nChanging ESPPORT\n"
|
||||
echo -e "TTY devices found in dmesg:"
|
||||
COUNTER=0
|
||||
|
||||
@@ -120,18 +120,13 @@ function messagePTS() {
|
||||
else
|
||||
message="Something happening! Maybe a shutdown!"
|
||||
fi
|
||||
|
||||
echo -e "\n\npts $(ls -q /dev/pts)\n\n"
|
||||
|
||||
|
||||
for pts in $(ls -q /dev/pts); do
|
||||
if [[ $pts =~ '^[0-9]+$' ]] && [[ "/dev/pts/$pts" != "$(tty)" ]]; then
|
||||
echo -e "\n\npts running $pts\ntty running: $(tty)\n\n";
|
||||
|
||||
if [[ "$pts" =~ ^[0-9]+$ ]] && [[ "/dev/pts/$pts" != "$(tty)" ]]; then
|
||||
sudo echo -e "$message" > /dev/pts/$pts # requires passwordless sudo
|
||||
writeToLog "PTS Message: $message send to /dev/$pts"
|
||||
fi
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
# this is not needed so long as warn doesnt god damned fucking work lmfao
|
||||
|
||||
+21
-12
@@ -1,19 +1,28 @@
|
||||
#!/bin/bash
|
||||
function subprocess() {
|
||||
echo -e "\nChanging ESPBAUD\n\t1: 9600\n\t2: 115200\n\t3: 230400\n\t4: 460800\n\t5: 1152000\n\t6: 1500000\n\nEnter Selection: "
|
||||
read baudRate
|
||||
echo -e "\n"
|
||||
case $baudRate in
|
||||
1) selection=9600;;
|
||||
2) selection=115200;;
|
||||
3) selection=230400;;
|
||||
4) selection=460800;;
|
||||
5) selection=1152000;;
|
||||
6) selection=1500000;;
|
||||
esac
|
||||
|
||||
function test_fun() {
|
||||
echo "function name? $0"
|
||||
eval "$1=$selection"
|
||||
return 0
|
||||
}
|
||||
|
||||
echo "script name? $0"
|
||||
test_fun
|
||||
test_fun "one" "two" 3
|
||||
|
||||
if [[ ! -z $1 ]]; then
|
||||
message="$1"
|
||||
if [ ! -z "$1" ]; then
|
||||
ret="$1"
|
||||
else
|
||||
message="PTS Default Message"
|
||||
ret=''
|
||||
subprocess ret
|
||||
fi
|
||||
|
||||
for pts in $(ls -q /dev/pts); do
|
||||
sudo echo "$message" > /dev/pts/$pts
|
||||
done
|
||||
export ESPBAUD=$ret
|
||||
echo -e "\nBaudrate set to $ESPBAUD\n"
|
||||
echo -e "\nAll done :3\n"
|
||||
Reference in New Issue
Block a user