forked from MrChromebox/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-kodi.sh
64 lines (56 loc) · 1.41 KB
/
setup-kodi.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
#!/bin/bash
#
# This script will prep supported
# ChromeOS devices for Kodi installation via
# LibreELEC or GalliumOS/Ubuntu
#
# Created by Mr.Chromebox <[email protected]>
#
# May be freely distributed and modified as needed,
# as long as proper attribution is given.
#
#where the stuff is
script_url="https://raw.githubusercontent.com/MrChromebox/scripts/master/"
#set working dir
if cat /etc/lsb-release | grep "Chrom" > /dev/null 2>&1; then
# needed for ChromeOS/ChromiumOS v82+
mkdir -p /usr/local/bin
cd /usr/local/bin
else
cd /tmp
fi
#check for cmd line param, expired CrOS certs
if ! curl -sLo /dev/null https://mrchromebox.tech/index.html || [[ "$1" = "-k" ]]; then
export CURL="curl -k"
else
export CURL="curl"
fi
#get support scripts
echo -e "\nDownloading supporting files..."
rm -rf firmware.sh >/dev/null 2>&1
rm -rf functions.sh >/dev/null 2>&1
rm -rf sources.sh >/dev/null 2>&1
rm -rf kodi.sh >/dev/null 2>&1
$CURL -sLO ${script_url}firmware.sh
rc0=$?
$CURL -sLO ${script_url}functions.sh
rc1=$?
$CURL -sLO ${script_url}sources.sh
rc2=$?
$CURL -sLO ${script_url}kodi.sh
rc3=$?
if [[ $rc0 -ne 0 || $rc1 -ne 0 || $rc2 -ne 0 || $rc3 -ne 0 ]]; then
echo -e "Error downloading one or more required files; cannot continue"
exit 1
fi
source ./sources.sh
source ./firmware.sh
source ./functions.sh
source ./kodi.sh
#set working dir
cd /tmp
#do setup stuff
prelim_setup
[[ $? -ne 0 ]] && exit 1
#show menu
menu_kodi