-
Notifications
You must be signed in to change notification settings - Fork 235
/
recalbox_install_gpi.sh
47 lines (39 loc) · 1.26 KB
/
recalbox_install_gpi.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
#!/bin/bash
#Step 1 make /boot writable---------------------------------
sleep 2s
filewebsite="https://raw.githubusercontent.com/RetroFlag/retroflag-picase/master"
mount -o remount, rw /boot
mount -o remount, rw /
#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_gpi.py"
else
wget --no-check-certificate -O $script "$filewebsite""/recalbox_SafeShutdown_gpi.py"
fi
#-----------------------------------------------------------
sleep 2s
#Step 4) Enable Python script to run on start up------------
DIR=/etc/init.d/S99RetroFlag
if grep -q "python $script &" "S99RetroFlag";
then
if [ -x $DIR];
then
echo "Executable S99RetroFlag already configured. Doing nothing."
else
chmod +x $DIR
fi
else
echo "python $script &" >> $DIR
chmod +x $DIR
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
#-----------------------------------------------------------