-
Notifications
You must be signed in to change notification settings - Fork 12
/
batocera_install_gpi2.sh
44 lines (36 loc) · 1.25 KB
/
batocera_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
#!/bin/bash
SourcePath=https://raw.githubusercontent.com/RetroFlag/GPiCase2-Script/main
#-----------------------------------------------------------
sleep 2s
mount -o remount, rw /boot
mount -o remount, rw /
#Download Python script-----------------------------
mkdir /userdata/RetroFlag
sleep 2s
script=/userdata/RetroFlag/SafeShutdown.py
wget -O $script "$SourcePath/batocera_SafeShutdown_gpi2.py"
wget -O "/userdata/RetroFlag/lcdfirst.sh" "$SourcePath/batoceralcdfirst.sh"
wget -O "/userdata/RetroFlag/lcdnext.sh" "$SourcePath/batoceralcdnext.sh"
#-----------------------------------------------------------
sleep 2s
DIR=/userdata/system/custom.sh
if grep -q "python $script &" "$DIR";
then
if [ -x "$DIR" ];
then
echo "Executable script already configured. Doing nothing."
else
chmod +x $DIR
fi
else
echo "python $script & sh /userdata/RetroFlag/lcdfirst.sh" >> $DIR
chmod +x $DIR
chmod +x /userdata/RetroFlag/lcdfirst.sh
chmod +x /userdata/RetroFlag/lcdnext.sh
echo "Executable script configured."
fi
#-----------------------------------------------------------
echo "RetroFlag Pi Case Switch installation done. Will now reboot after 3 seconds."
sleep 3
shutdown -r now
#-----------------------------------------------------------