forked from EA7KDO/NX4832K035
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSaveButton_mmdvm.sh
executable file
·42 lines (36 loc) · 1.26 KB
/
SaveButton_mmdvm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#! /bin/bash
#############################################
# Save MMDVM Button Red/Green Status
# #
# #
# #
# #
# #
# EA7KDO 10/1/2020 #
#############################################
set -o errexit
set -o pipefail
if [ "$1" = 0 ]; then
sudo rm -f /usr/local/etc/Nextion_Support/Test.txt
sudo echo "Red" >> /usr/local/etc/Nextion_Support/Test.txt
fi
if [ "$1" = 1 ]; then
sudo rm -f /usr/local/etc/Nextion_Support/Test.txt
sudo echo "Green" >> /usr/local/etc/Nextion_Support/Test.txt
fi
if [ "$1" = 2 ]; then
sudo rm -f /usr/local/etc/Nextion_Support/Test2.txt
sudo echo "Red" >> /usr/local/etc/Nextion_Support/Test2.txt
fi
if [ "$1" = 3 ]; then
sudo rm -f /usr/local/etc/Nextion_Support/Test2.txt
sudo echo "Green" >> /usr/local/etc/Nextion_Support/Test2.txt
fi
if [ "$1" = 4 ]; then
sudo rm -f /usr/local/etc/Nextion_Support/Test3.txt
sudo echo "Red" >> /usr/local/etc/Nextion_Support/Test3.txt
fi
if [ "$1" = 5 ]; then
sudo rm -f /usr/local/etc/Nextion_Support/Test3.txt
sudo echo "Green" >> /usr/local/etc/Nextion_Support/Test3.txt
fi