-
Notifications
You must be signed in to change notification settings - Fork 12
/
recalbox_install_gpi2.sh
71 lines (59 loc) · 2.07 KB
/
recalbox_install_gpi2.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
#Step 1 make /boot writable---------------------------------
sleep 2s
filewebsite="https://raw.githubusercontent.com/RetroFlag/GPiCase2-Script/main"
mount -o remount, rw /boot
mount -o remount, rw /
File=/boot/recalbox-config.txt
if grep -q "dtparam=audio" "$File";
then
sed -i '/dtparam=audio/c #dtparam=audio=off' $File
echo "ADUIO fix."
else
echo " #dtparam=audio=off" >> $File
echo "ADUIO enabled."
fi
#Step 3) Download Python script-----------------------------
mkdir /opt/RetroFlag
sleep 2s
script=/opt/RetroFlag/SafeShutdown.py
if [ -e $script ];
then
wget --no-check-certificate -O $script "$filewebsite""/recalbox_SafeShutdown_gpi2.py"
else
wget --no-check-certificate -O $script "$filewebsite""/recalbox_SafeShutdown_gpi2.py"
fi
wget --no-check-certificate -O "/opt/RetroFlag/lcdfirst.sh" "$filewebsite""/lcdfirst.sh"
wget --no-check-certificate -O "/opt/RetroFlag/lcdnext.sh" "$filewebsite""/lcdnext.sh"
#wget --no-check-certificate -O "/opt/RetroFlag/LCD.sh" "$filewebsite""/LCD.sh"
#-----------------------------------------------------------
sleep 2s
#Step 4) Enable Python script to run on start up------------
DIR=/etc/init.d/S99RetroFlag
#sed '1,40 d' /etc/init.d/S99RetroFlag
# chmod +x /opt/RetroFlag/lcdfirst.sh
# chmod +x /opt/RetroFlag/lcdnext.sh
if grep -q "python $script &" "$DIR";
then
if [ -x $DIR ];
then
echo "Executable S99RetroFlag already configured. Doing nothing."
else
chmod +x $DIR
fi
else
echo -e "python $script & \n sh /opt/RetroFlag/lcdfirst.sh \n" >> $DIR
# echo -e "python $script & \n/opt/RetroFlag/LCD.sh \n" >> $DIR
# echo "python $script &" >> $DIR
chmod +x $DIR
# chmod +x /opt/RetroFlag/LCD.sh
chmod +x /opt/RetroFlag/lcdfirst.sh
chmod +x /opt/RetroFlag/lcdnext.sh
echo "Executable S99RetroFlag configured."
fi
#-----------------------------------------------------------
#Step 5) Reboot to apply changes----------------------------
echo "RetroFlag Pi Case Switch installation done. Will now reboot after 3 seconds."
sleep 3
reboot
#-----------------------------------------------------------