-
Notifications
You must be signed in to change notification settings - Fork 16
/
install.sh
47 lines (32 loc) · 1.16 KB
/
install.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
# Step 1) Check if root ####################################
if [[ $EUID -ne 0 ]]; then
echo "Please execute script as root."
exit 1
fi
#-----------------------------------------------------------
# Step 2) Go to the right folder ###########################
cd /storage/
#-----------------------------------------------------------
#Step 3) Download this repository with all files needed ----
wget "https://github.com/marcelonovaes/lakka_nespi_power/archive/master.zip"
#-----------------------------------------------------------
#Step 4) Unpack files --------------------------------------
unzip -o master.zip
cd lakka_nespi_power-master/
cp -R lib/ /storage/
mkdir -p /storage/scripts
cp -R scripts/* /storage/scripts/
if [ ! -f /storage/.config/autostart.sh ]; then
echo "python /storage/scripts/shutdown.py &" >> /storage/.config/autostart.sh
fi
if grep -Fxq "shutdown.py" /storage/.config/autostart.sh
then
echo "not found"
echo "python /storage/scripts/shutdown.py &" >> /storage/.config/autostart.sh
else
echo "SUCCESS! Shutdown Script configured!"
echo "Installation done. Will now reboot after 3 seconds."
sleep 3
reboot
fi