forked from EA7KDO/NX4832K035
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopytft.sh
executable file
·39 lines (36 loc) · 1.21 KB
/
copytft.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
#!/bin/bash
#########################################################
# Nextion TFT Support for Nextion screen copy correct #
# file for user screen after Git Command. #
# KF6S 03-19-2019 #
#########################################################
# Use screen model from command $1
if [ -z "$1" ]; then
exit
fi
model=$1
tft='.tft' gz='.gz'
#Put Pi-Star file system in RW mode
sudo mount -o remount,rw /
sleep 1s
#Check to make sure that NO TFT file exists at the destination
sudo rm -f /usr/local/etc/$model$tft
sudo cp /home/pi-star/Nextion_Temp/$model$tft /usr/local/etc/$model$tft;
status=$?
if test $status -eq 0
then
echo "Nextion tft file successfully copied!"
else
#Put Pi-Star file system in RW mode
sudo mount -o remount,rw /
#Check to make sure that NO TFT file exists at the destination
sudo rm -f /usr/local/etc/$model$tft
sudo cp /home/pi-star/Nextion_Temp/$model$tft /usr/local/etc/$model$tft;
status=$?
if test $status -eq 0
then
echo "Nextion tft file successfully copied, on second try!"
else
echo "Nextion tft file copy failed!"
fi
fi