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