forked from RetroFlag/GPiCase2-Script
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbatoceralcdnext.sh
More file actions
33 lines (28 loc) · 836 Bytes
/
batoceralcdnext.sh
File metadata and controls
33 lines (28 loc) · 836 Bytes
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
HDMI_HPD=18
HDMI_HPD_VALUE=$(cat /sys/class/gpio/gpio$HDMI_HPD/value)
echo "HDMI_HPD_VALUE2=""$HDMI_HPD_VALUE"
if grep -q "enable_dpi_lcd=1" "/boot/config.txt" ; then
ISLCDFILE="1"
else
ISLCDFILE="0"
fi
echo "ISLCDFILE1=""$ISLCDFILE"
if [ "1" = $HDMI_HPD_VALUE ]; then
if [ "1" = $ISLCDFILE ]; then
mount -o remount, rw /boot
mount -o remount, rw /
rm -f /boot/config_lcd.txt
cp -f "/boot/config.txt" "/boot/config_lcd.txt"
rm -f /boot/config.txt
cp -f "/boot/config_hdmi.txt" "/boot/config.txt"
fi
else
if [ "0" = $ISLCDFILE ]; then
mount -o remount, rw /boot
mount -o remount, rw /
rm -f /boot/config_hdmi.txt
cp -f "/boot/config.txt" "/boot/config_hdmi.txt"
rm -f /boot/config.txt
cp -f "/boot/config_lcd.txt" "/boot/config.txt"
fi
fi